Skip to content

Commit

Permalink
ci: add separate release job
Browse files Browse the repository at this point in the history
  • Loading branch information
brettstack committed Dec 22, 2023
1 parent c88326c commit b2a3dfc
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/release-on-push-to-mainline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:

jobs:
build:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -32,27 +28,42 @@ jobs:

- name: Install
if: matrix.node-version != '14.x'
# Without --ignore-scripts we get "footer's lines must not be longer than 100 characters [footer-max-line-length]"
# on the release step
run: npm ci --ignore-scripts
run: npm ci

- name: Test
run: npm test

- name: Verify Typescript Types
if: matrix.node-version == '20.x'
run: npm run verify-typescript-types

- name: Lint
if: matrix.node-version == '20.x'
run: npm run lint

- name: Verify Typescript Types
if: matrix.node-version == '20.x'
run: npm run verify-typescript-types

- name: Audit
if: matrix.node-version == '20.x'
run: npm audit --audit-level critical
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/mainline'
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install
# Without --ignore-scripts we get "footer's lines must not be longer than 100 characters [footer-max-line-length]"
# on the release step
run: npm ci --ignore-scripts
- name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/mainline' && matrix.node-version == '20.x'
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit b2a3dfc

Please sign in to comment.