-
Notifications
You must be signed in to change notification settings - Fork 29
74 lines (64 loc) · 1.73 KB
/
publish-release.yaml
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
name: Publish ebook to release
on:
workflow_dispatch:
push:
branches:
- "main"
- "stable"
paths:
- ".github/workflows/build-ebook.yaml"
- ".github/workflows/publish-release.yaml"
- ".releaserc"
- "src/**"
- "theme/**"
- "book.toml"
- "package.json"
- "pnpm-lock.yaml"
- "flake.nix"
- "flake.lock"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
id-token: write
jobs:
build:
uses: ./.github/workflows/build-ebook.yaml
publish:
permissions:
contents: write
needs: build
if: ${{ !(github.event_name == 'push' && contains(github.event.head_commit.message, '[skip release]')) }}
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.TRIGGER_APP_ID }}
private-key: ${{ secrets.TRIGGER_APP_SECRET }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: current
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ebook
path: ebook
- name: Release ebook
env:
GITHUB_TOKEN: ${{ github.token }}
run: pnpm exec semantic-release