This repository was archived by the owner on Nov 19, 2025. It is now read-only.
chore: Update GitHub Actions workflows to use trusted publishers and latest action versions #51
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: π Validate | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: π¨ Build and Validate | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22, 24] | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@v5 | |
| - name: π’ Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: π¦ Install dependencies | |
| run: npm ci | |
| - name: π¨ Build | |
| run: npm run build | |
| - name: πΎ Cache build output | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| dist/ | |
| key: build-${{ matrix.node-version }}-${{ github.sha }} | |
| - name: π Type check | |
| run: npm run typecheck | |
| - name: π§Ή Lint | |
| run: npm run lint | |
| - name: π§ͺ Test | |
| run: npm run test:coverage | |
| - name: π Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| e2e: | |
| name: π E2E Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| node-version: [24] | |
| steps: | |
| - name: π₯ Checkout | |
| uses: actions/checkout@v5 | |
| - name: π’ Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: π¦ Install dependencies | |
| run: npm ci | |
| - name: π¨ Build | |
| run: npm run build | |
| # ensure we don't implicitly rely on dev dependencies | |
| - name: π¦ Prune dependencies | |
| run: npm prune --omit=dev | |
| - name: π§ͺ Run cross-env e2e tests | |
| run: node e2e/test-cross-env.js | |
| - name: π Run cross-env-shell e2e tests | |
| run: node e2e/test-cross-env-shell.js | |
| - name: π§ Run default value syntax e2e tests | |
| run: node e2e/test-default-values.js | |
| release: | |
| name: π Release | |
| needs: [build, e2e] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # to be able to publish a GitHub release | |
| id-token: write # to enable use of OIDC for npm provenance | |
| issues: write # to be able to comment on released issues | |
| pull-requests: write # to be able to comment on released pull requests | |
| if: | |
| ${{ github.repository == 'kentcdodds/cross-env' && | |
| contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', | |
| github.ref) && github.event_name == 'push' }} | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v5 | |
| - name: π Restore build output | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| dist/ | |
| key: build-24-${{ github.sha }} | |
| fail-on-cache-miss: false | |
| - name: π Release | |
| uses: cycjimmy/[email protected] | |
| with: | |
| semantic_version: 25 | |
| branches: | | |
| [ | |
| '+([0-9])?(.{+([0-9]),x}).x', | |
| 'main', | |
| 'next', | |
| 'next-major', | |
| {name: 'beta', prerelease: true}, | |
| {name: 'alpha', prerelease: true} | |
| ] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |