chore: button clean up (#1802) #581
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: Update Release PR or Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - v2.x.x | |
| paths: | |
| - '.github/workflows/main.yaml' | |
| - '.github/workflows/publish.yaml' | |
| - '.github/actions/setup-node/action.yaml' | |
| - 'packages/**' | |
| - 'package.json' | |
| - 'yarn.lock' | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| id-token: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout bifold-wallet | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup NodeJS | |
| uses: ./.github/actions/setup-node | |
| - name: Install dependencies | |
| run: | | |
| yarn install --immutable | |
| - name: Upgrade npm for Trusted Publishers support | |
| run: | | |
| npm install -g npm@^11 | |
| - name: Update release PR or publish to npm | |
| id: changesets | |
| uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3 | |
| with: | |
| title: 'chore(release): new version' | |
| commit: 'chore(release): new version' | |
| publish: ${{ github.ref == 'refs/heads/v2.x.x' && 'yarn release --tag legacy-v2' || 'yarn release' }} | |
| version: yarn changeset-version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Get current package version | |
| id: get_version | |
| run: echo "version=$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Create GitHub release | |
| if: "startsWith(github.event.head_commit.message, 'chore(release): new version')" | |
| uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 | |
| with: | |
| tag_name: v${{ steps.get_version.outputs.version }} |