-
Notifications
You must be signed in to change notification settings - Fork 1
140 lines (120 loc) · 4.07 KB
/
release.yml
File metadata and controls
140 lines (120 loc) · 4.07 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Release
on:
workflow_dispatch:
inputs:
dry-run:
description: "Dry run the release"
required: false
type: boolean
default: false
jobs:
prepare:
name: Determine next version
runs-on: ubuntu-latest
outputs:
new-release-version: ${{ steps.semantic.outputs.new-release-version }}
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_BOT_CLIENT_ID }}
private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install Modules
run: |
npm install \
@semantic-release/git \
@semantic-release/changelog \
@semantic-release/exec
- name: Determine next version
id: semantic
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: npx semantic-release --dry-run
build:
name: Build
needs: prepare
if: needs.prepare.outputs.new-release-version != ''
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.prepare.outputs.new-release-version }}
secrets: inherit
release:
name: Create Release
needs: [prepare, build]
if: inputs.dry-run != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_BOT_CLIENT_ID }}
private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- name: Get bot user ID
id: bot-user-id
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10.6'
- name: Setup UV
uses: astral-sh/setup-uv@v4
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install Modules
run: |
npm install -g rdme \
&& npm install \
@semantic-release/git \
@semantic-release/changelog \
@semantic-release/exec \
@semantic-release/github
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
pattern: lumos-*-v${{ needs.prepare.outputs.new-release-version }}
merge-multiple: true
- name: Create Release
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
RDME_API_KEY: ${{ secrets.RDME_API_KEY }}
GIT_AUTHOR_EMAIL: "${{ steps.bot-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
GIT_COMMITTER_EMAIL: "${{ steps.bot-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
run: npx semantic-release
release-homebrew:
name: Release Homebrew Tap
needs: [prepare, release]
if: inputs.dry-run != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.GH_BOT_CLIENT_ID }}
private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
repositories: homebrew-tap
- name: Trigger homebrew-tap release
run: |
curl -X POST \
-H "Authorization: token ${{ steps.app-token.outputs.token }}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/teamlumos/homebrew-tap/dispatches \
-d '{"event_type": "release", "client_payload": {"version": "${{ needs.prepare.outputs.new-release-version }}"}}'