-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (62 loc) · 2.32 KB
/
release.yml
File metadata and controls
64 lines (62 loc) · 2.32 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
name: release
on:
workflow_dispatch:
inputs:
version:
description: "version"
type: "choice"
required: true
default: "minor"
options:
- "major"
- "minor"
- "patch"
- "premajor"
- "preminor"
- "prepatch"
- "prerelease"
jobs:
release:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4.2.2
# https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v4.4.0
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
# https://github.com/marketplace/actions/cache
- uses: actions/cache@v4.2.3
with:
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- run: |
# https://www.npmjs.com/package/pnpm
npm install -g pnpm@10.9.0
pnpm config set store-dir ~/.local/share/pnpm/store
pnpm install
env:
PNPM_HOME: /home/runner/.local/bin
- run: make -j build lint test
- run: |
git config --global user.name "GitHub Actions (${GITHUB_ACTOR})"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: |
make doc
git add .
git commit -m "[skip ci] doc"
- run: npm version ${VERSION}
env:
VERSION: ${{ inputs.version }}
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
git push
git push --tags