Icons Release - main release version #161
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Icons Release | |
| run-name: Icons Release - ${{ github.event_name == 'release' && 'main release version' || 'dev release version' }} | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: [main] | |
| paths: | |
| - icons/** | |
| - .github/workflows/icons-release.yml | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC | |
| env: | |
| CI: true | |
| jobs: | |
| main-build: | |
| if: github.event_name == 'release' && contains(github.event.release.name, 'icons') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: icons | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: icons/.node-version | |
| registry-url: "https://registry.npmjs.org" | |
| cache: "pnpm" | |
| cache-dependency-path: icons/pnpm-lock.yaml | |
| - run: npm install -g npm@latest # Required for trusted publishing (npm 11.5.1 or later) | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Set release channel | |
| run: | | |
| echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV | |
| - name: Publish `@bcc-code/icons` | |
| run: npm publish --tag ${{ env.RELEASE_CHANNEL }} | |
| - name: Publish `@bcc-code/icons-vue` | |
| run: npm publish ./vue --tag ${{ env.RELEASE_CHANNEL }} | |
| dev-build: | |
| if: github.event_name != 'release' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: icons | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: icons/.node-version | |
| registry-url: "https://registry.npmjs.org" | |
| cache: "pnpm" | |
| cache-dependency-path: icons/pnpm-lock.yaml | |
| - run: npm install -g npm@latest # Required for trusted publishing (npm 11.5.1 or later) | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Resolve version | |
| id: vars | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Publish `@bcc-code/icons` | |
| run: | | |
| npm version 0.0.0-dev.${{ env.sha_short }} --force --no-git-tag-version | |
| npm publish --tag dev | |
| - name: Publish `@bcc-code/icons-vue` | |
| working-directory: icons/vue | |
| run: | | |
| npm version 0.0.0-dev.${{ env.sha_short }} --force --no-git-tag-version | |
| npm publish --tag dev |