[pull] main from vercel:main #129
This file contains 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: Test and Release | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install | |
uses: ./.github/workflows/install | |
- name: Lint and test | |
run: | | |
pnpm clean | |
pnpm build | |
pnpm run-all-checks | |
pnpm attw | |
pnpm test:build | |
e2e: | |
runs-on: ubuntu-latest | |
container: | |
image: mcr.microsoft.com/playwright:v1.34.3-focal | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install | |
uses: ./.github/workflows/install | |
- name: E2E Tests | |
run: | | |
pnpm clean | |
pnpm build | |
pnpm build:e2e | |
pnpm test:e2e | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: playwright-report | |
path: playwright-report | |
release: | |
runs-on: ubuntu-latest | |
needs: ["test", "e2e"] | |
if: startsWith(github.ref, 'refs/tags/v') | |
permissions: | |
id-token: write | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Install | |
uses: ./.github/workflows/install | |
- name: Determine tag | |
id: determine_tag | |
run: | | |
echo "tag=$(echo $GITHUB_REF | grep -Eo 'alpha|beta|canary|rc')" >> $GITHUB_OUTPUT | |
- name: Publish to versioned tag | |
if: steps.determine_tag.outputs.tag != '' | |
run: | | |
echo "Publishing to ${{ steps.determine_tag.outputs.tag }} tag" | |
npm publish --access public --no-git-checks --provenance --tag ${{ steps.determine_tag.outputs.tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} | |
- name: Publish to latest | |
if: steps.determine_tag.outputs.tag == '' | |
run: | | |
echo "Publishing to latest" | |
npm publish --access public --no-git-checks --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} |