chore(deps): maintain lockfiles (#719) #1715
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: Main | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| types: [opened, ready_for_review, reopened, synchronize] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| cache: pnpm | |
| node-version-file: package.json | |
| - name: Install dependencies | |
| run: pnpm bootstrap | |
| - env: | |
| TIMING: 1 | |
| name: Lint | |
| run: pnpm lint | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Build | |
| run: pnpm build | |
| release: | |
| env: | |
| DRY_RUN: ${{ github.ref_name != github.event.repository.default_branch }} | |
| name: Release | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: get-workflow-access-token | |
| name: Get Workflow Access Token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| with: | |
| app-id: ${{ secrets.APPLICATION_ID }} | |
| private-key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | |
| - name: Setup Git user | |
| run: | | |
| git config --global user.email '118100583+bfra-me[bot]@users.noreply.github.com' | |
| git config --global user.name 'bfra-me[bot]' | |
| - name: Checkout `release` branch | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| fetch-depth: 0 | |
| ref: release | |
| token: ${{ steps.get-workflow-access-token.outputs.token }} | |
| - if: ${{ github.event_name == 'pull_request' }} | |
| name: Fetch PR | |
| run: git fetch origin +${{ github.sha }}:${{ github.ref }} | |
| - id: merge | |
| name: Merge `main` into `release` | |
| run: | | |
| git merge --no-ff -Xtheirs -m 'skip: merge (${{ github.sha }}) [skip release]' ${{ github.sha }} | |
| echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | |
| with: | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| cache: pnpm | |
| node-version-file: package.json | |
| - name: Install dependencies | |
| run: pnpm bootstrap | |
| - if: env.DRY_RUN != 'true' | |
| name: Push `release` branch | |
| run: git push origin release:release | |
| - env: | |
| GIT_AUTHOR_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com' | |
| GIT_AUTHOR_NAME: 'bfra-me[bot]' | |
| GIT_COMMITTER_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com' | |
| GIT_COMMITTER_NAME: 'bfra-me[bot]' | |
| GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }} | |
| id: semantic-release | |
| name: Semantic Release | |
| run: | | |
| export GITHUB_REF=refs/heads/release GITHUB_SHA=${{ steps.merge.outputs.commit }} | |
| pnpm semantic-release --dry-run ${{ env.DRY_RUN }} --ci ${{ env.DRY_RUN != 'true' }} | |
| - if: github.event_name == 'push' && env.DRY_RUN != 'true' | |
| run: 'git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git refs/heads/release:refs/heads/v1' | |
| env: | |
| GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }} |