-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (84 loc) · 2.29 KB
/
release.yml
File metadata and controls
87 lines (84 loc) · 2.29 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Release
on:
push:
branches:
- main
- beta
workflow_dispatch:
inputs:
bump:
description: 'Version bump type (auto uses commit messages)'
required: false
default: 'auto'
type: choice
options:
- auto
- patch
- minor
- major
permissions:
contents: read
jobs:
test-job:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm clean-install
- name: Run tests
run: npm test
release:
name: Release
runs-on: ubuntu-latest
needs: [test-job]
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
- name: Force version bump
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.bump != 'auto' }}
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
BUMP="${{ github.event.inputs.bump }}"
if [ "$BUMP" = "major" ]; then
MSG="feat!: manual major release [skip ci]"
elif [ "$BUMP" = "minor" ]; then
MSG="feat: manual minor release [skip ci]"
else
MSG="fix: manual patch release [skip ci]"
fi
git commit --allow-empty -m "$MSG"
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
run: npx semantic-release