ci: fix the release script #18
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 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Set node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: Setup | |
run: npm i -g @antfu/ni | |
- name: Install | |
run: nci | |
- name: Lint | |
run: nr lint | |
typecheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Set node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: Setup | |
run: npm i -g @antfu/ni | |
- name: Install | |
run: nci | |
- name: Typecheck | |
run: nr typecheck | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node: [lts/*] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Set node ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Setup | |
run: npm i -g @antfu/ni | |
- name: Install | |
run: nci | |
- name: Build | |
run: nr build | |
- name: Generate Dates | |
run: nr date:generate | |
- name: Test | |
run: nr test | |
release: | |
runs-on: ubuntu-latest | |
name: Release | |
needs: test | |
if: github.event_name == 'push' | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup | |
run: npm i -g @antfu/ni | |
- run: nr build | |
- name: Preparing a release 🚀 | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
node-version: 18.x | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |