-
-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (56 loc) · 1.58 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: release
on:
workflow_dispatch:
inputs:
version:
type: choice
description: Version number to increment
required: true
default: minor
options:
- patch
- minor
- major
jobs:
release:
env:
CI: true
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Need history for changelog generation
- uses: asdf-vm/actions/install@v3
- run: pnpm i --frozen-lockfile
- name: types
run: pnpm check:types
- name: build
run: pnpm build
- name: test
id: test
if: ${{ always() }}
run: pnpm test:coverage
- name: lint
if: ${{ always() }}
run: pnpm lint
- name: style
if: ${{ always() }}
run: pnpm format:check
- name: npm registry auth
run: pnpm config set "//registry.npmjs.org/:_authToken" ${{ env.NPM_TOKEN }}
- name: config git user
run: |
git config --global user.name ${{ secrets.ACTION_GITHUB_USERNAME }};
git config --global user.email ${{ secrets.ACTION_GITHUB_EMAIL }};
- name: perform release
run: |
pnpm release \
${{ github.event.inputs.version }} \
--ci
- name: codecov # Perform after version publishing
if: steps.test.outcome == 'success'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}