Version Packages (#318) #1042
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: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBOREPO_REMOTE_CACHING_TOKEN }} | |
| TURBO_TEAM: vercel | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| # Cancel in progress if the workflow is a pull request | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| prepare: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.generate.outputs.matrix }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Generate matrix | |
| id: generate | |
| uses: docker/bake-action/subaction/matrix@v7 | |
| with: | |
| workdir: images | |
| target: default | |
| images: | |
| name: Images | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| needs: | |
| - prepare | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Build Images | |
| uses: docker/bake-action@v7 | |
| with: | |
| source: images | |
| targets: ${{ matrix.target }} | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.16.0" | |
| cache: "pnpm" | |
| - run: pnpm install | |
| shell: bash | |
| - name: Build Monorepo | |
| run: pnpm run build | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Create Release Pull Request | |
| uses: changesets/action@v1 | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| version: pnpm version:prepare | |
| publish: pnpm release | |
| commitMode: github-api | |
| release: | |
| name: Release | |
| needs: | |
| - images | |
| - publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - run: echo "Done" |