name: Deploy on: push: branches: - develop - release - master jobs: canary: runs-on: ubuntu-latest 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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 with: standalone: true - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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-latest 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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 with: standalone: true - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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-latest environment: registry.npmjs.org permissions: # Required for OIDC id-token: write contents: write # create the release tag if: github.ref_name == 'master' && github.repository_owner == 'dequelabs' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 with: standalone: true - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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 # 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: | PKG_VERSION=$(jq -r .version < lerna.json) gh release create "v$PKG_VERSION" \ --title "Release $PKG_VERSION" \ --generate-notes \ --target "$GITHUB_SHA" env: GH_TOKEN: ${{ github.token }}