Version Packages (#135) #66
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".changeset/**" | |
| - "src/**" | |
| - "package.json" | |
| workflow_dispatch: | |
| inputs: | |
| action: | |
| description: "Choose an action" | |
| required: true | |
| default: "version" | |
| type: choice | |
| options: | |
| - version | |
| - release | |
| workflow_call: # Allow this workflow to be called by other workflows | |
| concurrency: | |
| group: release-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| # Only run release process after main CI/CD pipeline passes | |
| version-or-release: | |
| name: Create Version PR or Release | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write # to create release (changesets/action) | |
| issues: write # to post issue comments (changesets/action) | |
| pull-requests: write # to create pull request (changesets/action) | |
| id-token: write # to use OpenID Connect token for provenance (changesets/action) | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Check changeset status | |
| run: | | |
| echo "Checking changeset status..." | |
| pnpm exec changeset status | |
| echo "Listing changesets..." | |
| ls -la .changeset/ | |
| - name: Create Release Pull Request or Publish to npm | |
| # https://github.com/changesets/action | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| # this expects you to have a script called changeset:release which does a build for your packages and calls changeset publish | |
| publish: pnpm changeset:publish | |
| commit: "chore: version packages" # we need to fulfill commitlint based rules | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HUSKY: 0 # Disable Husky hooks in CI |