Update Changesets release tooling to v3 (#11) #9
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] | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| concurrency: | |
| group: changesets-release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 | |
| with: | |
| node-version: "24" | |
| package-manager-cache: false | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Update npm for trusted publishing | |
| run: npm install --global npm@latest | |
| - name: Test | |
| run: npm test | |
| - name: Lint the package | |
| run: npx --yes publint@0.3.24 | |
| - name: Pack and smoke-test the executable | |
| shell: bash | |
| run: | | |
| package_root=$(mktemp -d) | |
| install_root=$(mktemp -d) | |
| npm pack --pack-destination "$package_root" | |
| package_files=("$package_root"/*.tgz) | |
| test -f "${package_files[0]}" | |
| test "${#package_files[@]}" -eq 1 | |
| npm install --global --prefix "$install_root" "${package_files[0]}" | |
| "$install_root/bin/gbot" --help | |
| - name: Create release pull request or publish | |
| id: changesets | |
| uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1 | |
| with: | |
| pr-base-branch: main | |
| commit-message: Release packages | |
| create-github-releases: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| publish-script: npm run release | |
| pr-title: Release packages |