-
-
Notifications
You must be signed in to change notification settings - Fork 2
170 lines (143 loc) · 5.22 KB
/
Copy pathrelease.yml
File metadata and controls
170 lines (143 loc) · 5.22 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
container:
image: golang:1.26-alpine
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Extracted version: ${VERSION}"
- name: Install dependencies
run: |
apk add --no-cache make zip tar bash gzip
- name: Test build
run: |
make test
- name: Build binaries
run: |
make build-windows-amd64
make build-windows-arm64
make build-linux-amd64
make build-linux-arm64
make build-macos
# WASM release artifacts are deprecated. The browser runtime is kept only
# for historical reference and is no longer built or published in releases.
#
# - name: Build WASM
# run: |
# make build-wasm
- name: Prepare packaging directory
run: |
mkdir -p packages
- name: Package all binaries
run: |
VERSION="${{ steps.get_version.outputs.version }}"
# Function to package binaries
package_binary() {
local platform=$1
local arch=$2
local ext=$3
local compress=$4
local pkg_name="synapseq-${VERSION}-${platform}-${arch}"
local bin_src="bin/synapseq-${platform}-${arch}${ext}"
local bin_name="synapseq-${VERSION}-${platform}-${arch}${ext}"
local sha_name="${bin_name}.sha256"
echo "Packaging ${pkg_name}..."
# Create temporary directory for packaging
mkdir -p "temp-${pkg_name}"
# Copy binary with versioned name
cp "${bin_src}" "temp-${pkg_name}/${bin_name}"
# Set executable permission for Unix systems
if [ -z "$ext" ]; then
chmod +x "temp-${pkg_name}/${bin_name}"
fi
# Generate SHA256 for the binary
cd "temp-${pkg_name}"
sha256sum "${bin_name}" > "${sha_name}"
cd ..
echo "✓ SHA256 generated: ${sha_name}"
# Create compressed package
if [ "$compress" = "zip" ]; then
cd "temp-${pkg_name}"
zip "../packages/${pkg_name}.zip" "${bin_name}" "${sha_name}"
cd ..
else
tar -czf "packages/${pkg_name}.tar.gz" -C "temp-${pkg_name}" "${bin_name}" "${sha_name}"
fi
# Clean up temporary directory
rm -rf "temp-${pkg_name}"
echo "✓ ${pkg_name} packaged successfully"
}
# Package Windows binaries (ZIP format)
package_binary "windows" "amd64" ".exe" "zip"
package_binary "windows" "arm64" ".exe" "zip"
# Package Linux binaries (TAR.GZ format)
package_binary "linux" "amd64" "" "tar.gz"
package_binary "linux" "arm64" "" "tar.gz"
# Package macOS binaries (TAR.GZ format)
package_binary "macos" "arm64" "" "tar.gz"
# WASM release artifacts are deprecated. The browser runtime is kept only
# for historical reference and is no longer built or published in releases.
#
# - name: Package WASM
# run: |
# VERSION="${{ steps.get_version.outputs.version }}"
# pkg_name="synapseq-${VERSION}-wasm"
#
# echo "Packaging WASM version..."
#
# # Create temporary directory for packaging
# mkdir -p "temp-${pkg_name}"
#
# # Copy WASM files
# cp wasm/synapseq.wasm "temp-${pkg_name}/"
# cp wasm/synapseq.js "temp-${pkg_name}/"
# cp wasm/wasm_exec.js "temp-${pkg_name}/"
# cp wasm/example.html "temp-${pkg_name}/"
#
# # Generate SHA256 checksums for WASM files
# cd "temp-${pkg_name}"
# sha256sum synapseq.wasm synapseq.js wasm_exec.js example.html > checksums.txt
# cd ..
# echo "✓ SHA256 checksums generated for WASM files"
#
# # Create ZIP package
# cd "temp-${pkg_name}"
# zip "../packages/${pkg_name}.zip" synapseq.wasm synapseq.js wasm_exec.js example.html checksums.txt
# cd ..
#
# # Clean up temporary directory
# rm -rf "temp-${pkg_name}"
# echo "✓ ${pkg_name} packaged successfully"
- name: Generate checksums
run: |
cd packages
sha256sum *.zip *.tar.gz > checksums.txt
cat checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: SynapSeq ${{ steps.get_version.outputs.version }}
files: |
packages/*.zip
packages/*.tar.gz
packages/checksums.txt
draft: true
prerelease: false
generate_release_notes: no
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}