-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 3.33 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (89 loc) · 3.33 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: macos-latest
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Install Rust
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # master
with:
toolchain: "1.95.0"
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Install Node 22
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- name: Install pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
with:
run_install: false
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate DMG background
run: node scripts/make-dmg-bg.js
- name: Build universal macOS app
run: pnpm tauri build --target universal-apple-darwin
- name: Prepare release assets
run: |
VERSION="${GITHUB_REF_NAME#v}"
DMG_NAME="NodeNet_${VERSION}_universal.dmg"
DMG_PATH="src-tauri/target/universal-apple-darwin/release/bundle/dmg/${DMG_NAME}"
UPDATE_NAME="NodeNet.app.tar.gz"
UPDATE_PATH="src-tauri/target/universal-apple-darwin/release/bundle/macos/${UPDATE_NAME}"
SIG_PATH="${UPDATE_PATH}.sig"
PUB_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
if [ ! -f "${DMG_PATH}" ]; then
echo "ERROR: DMG not found at ${DMG_PATH}"
find src-tauri/target/universal-apple-darwin/release/bundle -type f || true
exit 1
fi
if [ ! -f "${UPDATE_PATH}" ]; then
echo "ERROR: Updater artifact not found at ${UPDATE_PATH}"
find src-tauri/target/universal-apple-darwin/release/bundle -type f || true
exit 1
fi
if [ ! -f "${SIG_PATH}" ]; then
echo "ERROR: Updater signature not found at ${SIG_PATH}"
find src-tauri/target/universal-apple-darwin/release/bundle -type f || true
exit 1
fi
cp "${DMG_PATH}" "${DMG_NAME}"
cp "${UPDATE_PATH}" "${UPDATE_NAME}"
SIGNATURE=$(cat "${SIG_PATH}")
UPDATE_URL="https://github.com/DarkDo11/NodeNet/releases/download/v${VERSION}/${UPDATE_NAME}"
cat > latest.json << EOF
{
"version": "v${VERSION}",
"notes": "NodeNet v${VERSION}",
"pub_date": "${PUB_DATE}",
"platforms": {
"darwin-x86_64": {
"url": "${UPDATE_URL}",
"signature": "${SIGNATURE}"
},
"darwin-aarch64": {
"url": "${UPDATE_URL}",
"signature": "${SIGNATURE}"
}
}
}
EOF
echo "Generated latest.json:"
cat latest.json
- name: Publish GitHub Release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
files: |
NodeNet_*_universal.dmg
NodeNet.app.tar.gz
latest.json