-
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (81 loc) · 2.66 KB
/
Copy pathrelease.yml
File metadata and controls
102 lines (81 loc) · 2.66 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
name: Release
on:
release:
types: [published]
workflow_dispatch: # Allow manual triggering
permissions:
contents: write # Required to upload release assets
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies
run: npm i
- name: Build
run: npm run build
- name: Build binaries
run: |
# Get version from tag (remove 'v' prefix)
VERSION=${GITHUB_REF#refs/tags/v}
echo "Version: $VERSION"
# Build each platform separately and rename immediately to avoid conflicts
# Build Linux
npm run build:linux
cd binaries
mv jelly jelly-linux
cd ..
# Build Windows
npm run build:windows
# Windows creates jelly.exe, no need to rename yet
# Build macOS
npm run build:mac
cd binaries
mv jelly jelly-macos # Rename immediately to avoid overwriting Linux
cd ..
# List what we have
ls -la binaries/
# Now zip everything with proper names
cd binaries
# Zip Linux binary
if [ -f "jelly-linux" ]; then
zip "jelly-${VERSION}-linux-x86_64.zip" jelly-linux
rm jelly-linux
fi
# Zip Windows binary
if [ -f "jelly.exe" ]; then
zip "jelly-${VERSION}-windows-x86_64.zip" jelly.exe
rm jelly.exe
fi
# Zip macOS binary
if [ -f "jelly-macos" ]; then
zip "jelly-${VERSION}-macos-x86_64.zip" jelly-macos
rm jelly-macos
fi
# List final files
ls -la
# Create checksums for Aftman
for file in *.zip; do
if [ -f "$file" ]; then
sha256sum "$file" > "${file}.sha256"
fi
done
- name: Upload Release Assets
run: |
# Get version from tag
VERSION=${GITHUB_REF#refs/tags/v}
# Upload all zip files and their checksums
gh release upload ${{ github.event.release.tag_name }} \
binaries/jelly-${VERSION}-linux-x86_64.zip \
binaries/jelly-${VERSION}-linux-x86_64.zip.sha256 \
binaries/jelly-${VERSION}-windows-x86_64.zip \
binaries/jelly-${VERSION}-windows-x86_64.zip.sha256 \
binaries/jelly-${VERSION}-macos-x86_64.zip \
binaries/jelly-${VERSION}-macos-x86_64.zip.sha256 \
--clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}