Repository navigation
Prepare Effect API Query 0.1.0 with HTTP streams and typed cache helpers #105
Workflow file for this run
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: | |
| pull_request: | |
| paths: | |
| - .changeset/** | |
| - .github/workflows/release.yml | |
| - package.json | |
| - pnpm-lock.yaml | |
| - pnpm-workspace.yaml | |
| - scripts/verify-packed-consumer.mts | |
| - vite.config.ts | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| select-mode: | |
| name: Select release mode | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| outputs: | |
| mode: ${{ steps.changesets.outputs.mode }} | |
| publish-plan-artifact-id: ${{ steps.changesets.outputs.publish-plan-artifact-id }} | |
| steps: | |
| - &checkout | |
| name: Check out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - &setup_repository | |
| name: Set up repository | |
| uses: ./.github/actions/setup-repository | |
| with: | |
| cache: false | |
| - name: Select Changesets mode | |
| id: changesets | |
| uses: changesets/action/select-mode@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1 | |
| - name: Reject placeholder publication | |
| if: steps.changesets.outputs.mode == 'publish' && github.event_name == 'push' | |
| shell: bash | |
| run: | | |
| version="$(node --print "require('./package.json').version")" | |
| if [[ "$version" == "0.0.0" ]]; then | |
| echo '::error::Refusing to publish the placeholder 0.0.0 version. Add and merge a real release Changeset first.' | |
| exit 1 | |
| fi | |
| version: | |
| name: Create or update version pull request | |
| if: needs.select-mode.outputs.mode == 'version' && github.event_name == 'push' | |
| needs: | |
| - select-mode | |
| - quality-and-pack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - *checkout | |
| - *setup_repository | |
| - name: Create or update version pull request | |
| uses: changesets/action/version@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1 | |
| with: | |
| commit-message: Version Packages | |
| pr-title: Version Packages | |
| script: vp run version-packages | |
| quality-and-pack: | |
| name: Validate and pack release artifact | |
| if: needs.select-mode.outputs.mode != 'none' || github.event_name != 'push' | |
| needs: select-mode | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| permissions: | |
| contents: read | |
| outputs: | |
| pack-dir-artifact-id: ${{ steps.pack.outputs.pack-dir-artifact-id }} | |
| steps: | |
| - *checkout | |
| - *setup_repository | |
| - name: Construct package for release packing | |
| if: needs.select-mode.outputs.mode == 'publish' || github.event_name != 'push' | |
| run: vp run pack | |
| - name: Pack release artifact | |
| if: needs.select-mode.outputs.mode == 'publish' || github.event_name != 'push' | |
| id: pack | |
| uses: changesets/action/pack@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1 | |
| with: | |
| publish-plan-artifact-id: ${{ needs.select-mode.outputs.publish-plan-artifact-id }} | |
| - name: Download the release artifact for verification | |
| if: needs.select-mode.outputs.mode == 'publish' || github.event_name != 'push' | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| artifact-ids: ${{ steps.pack.outputs.pack-dir-artifact-id }} | |
| path: .artifacts/release | |
| - name: Select the release archive | |
| if: needs.select-mode.outputs.mode == 'publish' || github.event_name != 'push' | |
| shell: bash | |
| run: | | |
| mapfile -t archives < <(find .artifacts/release/packages -type f -name '*.tgz' -print) | |
| if [[ "${#archives[@]}" -ne 1 ]]; then | |
| echo "::error::Expected one release archive, found ${#archives[@]}." | |
| exit 1 | |
| fi | |
| echo "EFFECT_API_QUERY_TARBALL=${archives[0]}" >> "$GITHUB_ENV" | |
| - name: Install browser engines and system dependencies | |
| if: github.event_name == 'push' | |
| run: vp exec playwright install --with-deps chromium firefox webkit | |
| - name: Run complete repository validation | |
| if: github.event_name == 'push' | |
| run: vp run validate | |
| - name: Install Chromium for dry-run framework consumers | |
| if: github.event_name != 'push' | |
| run: vp exec playwright install --with-deps chromium | |
| - name: Verify dry-run artifact | |
| if: github.event_name != 'push' | |
| run: vp run verify-packed-package | |
| publish: | |
| name: Publish verified artifact | |
| if: needs.select-mode.outputs.mode == 'publish' && github.event_name == 'push' | |
| needs: | |
| - select-mode | |
| - quality-and-pack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| environment: npm | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - *checkout | |
| - *setup_repository | |
| - name: Publish verified artifact to npm | |
| uses: changesets/action/publish@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1 | |
| with: | |
| create-github-releases: false | |
| pack-dir-artifact-id: ${{ needs.quality-and-pack.outputs.pack-dir-artifact-id }} | |
| env: | |
| NPM_CONFIG_ACCESS: public | |
| NPM_CONFIG_PROVENANCE: true | |
| deploy-docs: | |
| name: Deploy published documentation | |
| if: needs.publish.result == 'success' | |
| needs: publish | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pages: write | |
| uses: ./.github/workflows/deploy-docs.yml |