Component Library - main release version #561
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: "Component Library: Release" | |
| run-name: Component Library - main release version | |
| on: | |
| push: | |
| tags: | |
| - "component-library-*" | |
| paths: | |
| - component-library/** | |
| - .github/workflows/design-library-release.yml | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC | |
| env: | |
| CI: true | |
| jobs: | |
| main-build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: component-library | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| cache: "pnpm" | |
| cache-dependency-path: component-library/pnpm-lock.yaml | |
| - run: | | |
| npm install -g npm@~11.10.0 | |
| 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 package | |
| run: pnpm build | |
| - name: Set release channel | |
| run: | | |
| echo "RELEASE_CHANNEL=$(pnpm --silent run release-channel)" >> $GITHUB_ENV | |
| - name: Publish `@bcc-code/component-library-vue` | |
| run: npm publish --tag ${{ env.RELEASE_CHANNEL }} | |
| - name: Resolve release metadata from tag | |
| id: release_vars | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| RELEASE_DESCRIPTION="$(git tag -l --format='%(contents)' "$TAG_NAME" | sed '1,/^$/d')" | |
| { | |
| echo "TAG_NAME=$TAG_NAME" | |
| echo "RELEASE_DESCRIPTION<<EOF" | |
| echo "$RELEASE_DESCRIPTION" | |
| echo "EOF" | |
| } >> $GITHUB_OUTPUT | |
| working-directory: . | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| token: ${{ secrets.BCC_BOT_ACCESS_TOKEN }} | |
| draft: false | |
| name: "component-library ${{ steps.release_vars.outputs.TAG_NAME }}" | |
| tag_name: ${{ steps.release_vars.outputs.TAG_NAME }} | |
| body: ${{ steps.release_vars.outputs.RELEASE_DESCRIPTION }} | |
| generate_release_notes: true |