-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (66 loc) · 2.23 KB
/
release.yml
File metadata and controls
79 lines (66 loc) · 2.23 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. 0.2.0)"
required: true
type: string
permissions:
contents: write
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
needs: ci
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_PAT }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Set version
id: version
run: |
npm version ${{ github.event.inputs.version }} --no-git-tag-version --allow-same-version
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git diff --cached --quiet || git commit -m "Bump version to ${{ steps.version.outputs.version }}"
git push
- name: Install dependencies
run: npm ci
- name: Setup Python for node-gyp
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install setuptools for node-gyp
run: python -m pip install setuptools
- name: Build
run: npm run build
- name: Package and publish
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx electron-builder --mac --arm64 --publish always
- name: Add release notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="v${{ steps.version.outputs.version }}"
NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
-f tag_name="$TAG" \
--jq '.body')
gh release edit "$TAG" --notes "$NOTES"