name: Deploy on: push: branches: - develop - release - master jobs: canary: runs-on: ubuntu-26.04 timeout-minutes: 10 environment: registry.npmjs.org permissions: # Required for OIDC id-token: write contents: read if: github.ref_name == 'develop' && github.repository_owner == 'dequelabs' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: registry-url: 'https://registry.npmjs.org/' node-version-file: .nvmrc cache: 'pnpm' - run: pnpm install --frozen-lockfile # Ensure packages are built - run: pnpm run build # Make sure the working tree is clean - run: git reset --hard HEAD - run: | pnpm exec lerna publish prepatch \ --no-verify-access \ --no-git-tag-version \ --no-push \ --canary \ --dist-tag=next \ --exact \ --preid=$(git rev-parse --short HEAD) \ --force-publish \ --yes release-candidate: runs-on: ubuntu-26.04 environment: registry.npmjs.org permissions: # Required for OIDC id-token: write contents: read if: github.ref_name == 'release' && github.repository_owner == 'dequelabs' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: registry-url: 'https://registry.npmjs.org/' node-version-file: .nvmrc cache: 'pnpm' - run: pnpm install --frozen-lockfile # Ensure packages are built - run: pnpm run build # Make sure the working tree is clean - run: git reset --hard HEAD - run: | pnpm exec lerna publish prepatch \ --no-verify-access \ --no-git-tag-version \ --no-push \ --canary \ --dist-tag=rc \ --exact \ --preid=$(git rev-parse --short HEAD) \ --force-publish \ --yes production: runs-on: ubuntu-26.04 environment: registry.npmjs.org permissions: # Required for OIDC id-token: write contents: read if: github.ref_name == 'master' && github.repository_owner == 'dequelabs' outputs: version: ${{ steps.version.outputs.version }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: standalone: true - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: registry-url: 'https://registry.npmjs.org/' node-version-file: .nvmrc cache: 'pnpm' - run: pnpm install --frozen-lockfile # Ensure packages are built - run: pnpm run build # Make sure the working tree is clean - run: git reset --hard HEAD - run: | pnpm exec lerna publish from-package \ --force-publish='*' \ --yes - id: version run: | version=$(jq -er .version < lerna.json) echo "version=$version" >> "$GITHUB_OUTPUT" github-release: needs: production runs-on: ubuntu-slim timeout-minutes: 10 environment: github-release permissions: {} steps: # Nothing tags the release commit beforehand, so `gh release create` creates # the tag at --target and the notes come from merged PRs rather than the tag. - name: Create GitHub release run: | gh release create "v$PKG_VERSION" \ --repo "$GITHUB_REPOSITORY" \ --title "Release $PKG_VERSION" \ --generate-notes \ --target "$GITHUB_SHA" env: GH_TOKEN: ${{ secrets.PAT }} PKG_VERSION: ${{ needs.production.outputs.version }}