update ci #12
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
verify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: common/temp/pnpm-store | |
key: ${{ runner.os }}-{{ hashFiles('common/config/rush/pnpm-lock.yaml') }} | |
- name: Assert dependency versions | |
run: node common/scripts/install-run-rush.js check | |
- name: Assert Changelogs | |
run: node common/scripts/install-run-rush.js change --verify | |
test-packages: | |
needs: verify | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: common/temp/pnpm-store | |
key: ${{ runner.os }}-{{ hashFiles('common/config/rush/pnpm-lock.yaml') }} | |
- name: Rush Install | |
run: node common/scripts/install-run-rush.js install --to tag:package | |
- name: Build | |
run: | | |
node common/scripts/install-run-rush.js build --to tag:package | |
- name: Test | |
run: | | |
node common/scripts/install-run-rush.js test --to tag:package | |
publsh: | |
runs-on: ubuntu-latest | |
needs: [test-packages] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PUSH_TOKEN }} | |
- name: Init git | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: common/temp/pnpm-store | |
key: ${{ runner.os }}-{{ hashFiles('common/config/rush/pnpm-lock.yaml') }} | |
- name: Rush Install | |
run: node common/scripts/install-run-rush.js install --to tag:package | |
- name: Rush Build | |
run: node common/scripts/install-run-rush.js build --to tag:package | |
- name: Publish | |
run: node common/scripts/install-run-rush.js publish --publish -n ${{ secrets.NPM_TOKEN }} --set-access-level public --apply | |
- name: Commit | |
run: | | |
git add -A | |
git commit --no-verify -m "[skip ci] version bump" | |
git push | |