Release #14
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: | |
| workflow_dispatch: | |
| inputs: | |
| packageVersion: | |
| description: "The version to publish in MAJOR.MINOR.PATCH format" | |
| required: true | |
| default: "" | |
| jobs: | |
| authorize: | |
| name: Authorize | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: ${{ github.actor }} permission check to update release version | |
| uses: "lannonbr/repo-permission-check-action@2.0.2" | |
| with: | |
| permission: "write" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: 'Setup' | |
| uses: ./.github/actions/setup | |
| - name: Set version | |
| run: npm version ${{ env.PACKAGE_VERSION }} -w packages/wallet-sdk | |
| # Build the package | |
| - name: Prebuild | |
| run: yarn workspace @coinbase/wallet-sdk prebuild | |
| - name: Build SDK | |
| shell: bash | |
| run: yarn workspace @coinbase/wallet-sdk build | |
| # Create a pull request to update the version | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@v4 | |
| with: | |
| title: "[Version update] v${{ env.PACKAGE_VERSION }}" | |
| body: "Automated workflow: version update" | |
| branch: release-v${{ env.PACKAGE_VERSION }} | |
| delete-branch: true | |
| commit-message: "v${{ env.PACKAGE_VERSION }}" | |
| labels: version-update | |
| # Publish to npm | |
| - name: Set deployment token | |
| run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" | |
| - name: Publish to npm | |
| run: cd packages/wallet-sdk && npm publish --tag latest | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |