ci(beta): consolidate release workflows in a single one #1277
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: CI | |
| on: | |
| push: | |
| branches: [main, beta] | |
| pull_request: | |
| branches: [main, beta] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Linters | |
| run: npm run lint | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| e2e-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install playwright | |
| run: npx playwright install --with-deps | |
| - name: Run E2E tests | |
| run: npm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-test-results | |
| path: test-results/ | |
| release: | |
| name: Release | |
| if: github.ref == 'refs/heads/main' | |
| needs: [lint, unit-test, e2e-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: 🚀 Create/Update Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: npm run version | |
| publish: npm run release | |
| title: "chore(new-release)" | |
| commit: "chore(new-release)" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} | |
| NPM_TOKEN: ${{ secrets.NPM_API_KEY }} | |
| release-beta: | |
| name: Release Beta | |
| if: github.ref == 'refs/heads/beta' | |
| needs: [lint, unit-test, e2e-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: 🚀 Create/Update Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: npm run version | |
| publish: npm run release | |
| title: "chore(new-beta-release)" | |
| commit: "chore(new-beta-release)" | |
| branch: "beta" | |
| createGithubReleases: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} | |
| NPM_TOKEN: ${{ secrets.NPM_API_KEY }} | |
| # cancel the jobs if another workflow is kicked off for the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true |