Repository navigation
310 lines (255 loc) · 9.52 KB
/
Copy pathrelease.yml
File metadata and controls
310 lines (255 loc) · 9.52 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
name: Build and Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.0.0)'
required: true
type: string
source_repo:
description: 'Source repository (e.g., user/repo)'
required: true
type: string
default: 'Soar-Development/desktop-orchestrator'
source_ref:
description: 'Source branch/tag (e.g., main, v1.0.0)'
required: true
type: string
default: 'main'
permissions:
contents: write # Required to create releases and upload assets
actions: read # Required to read workflow artifacts
packages: write # Required for package operations
jobs:
build:
name: Build Multi-Architecture Binaries
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
goarch: amd64
- arch: arm64
goarch: arm64
- arch: armv7
goarch: arm
goarm: "7"
steps:
- name: Checkout runsand-install repository
uses: actions/checkout@v4
- name: Checkout source repository
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.source_repo }}
ref: ${{ github.event.inputs.source_ref }}
path: source
token: ${{ secrets.SOURCE_REPO_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
cache-dependency-path: source/client/go.sum
- name: Install Garble
run: go install mvdan.cc/garble@latest
- name: Build binary
env:
GOOS: linux
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: 0
run: |
cd source/client
# Set version in build
VERSION="${{ github.event.inputs.version }}"
LDFLAGS="-X main.version=${VERSION} -s -w"
# Build obfuscated binary
garble -literals -tiny -seed=random build -ldflags "${LDFLAGS}" -o "../../runsand-linux-${{ matrix.arch }}" ./cmd/client
# Verify binary
file "../../runsand-linux-${{ matrix.arch }}"
ls -la "../../runsand-linux-${{ matrix.arch }}"
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: runsand-linux-${{ matrix.arch }}
path: runsand-linux-${{ matrix.arch }}
retention-days: 1
package:
name: Create Debian Packages
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
include:
- arch: amd64
deb_arch: amd64
- arch: arm64
deb_arch: arm64
- arch: armv7
deb_arch: armhf
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download binary artifact
uses: actions/download-artifact@v4
with:
name: runsand-linux-${{ matrix.arch }}
- name: Create Debian package
run: |
VERSION="${{ github.event.inputs.version }}"
CLEAN_VERSION="${VERSION#v}" # Remove 'v' prefix
BINARY_NAME="runsand-linux-${{ matrix.arch }}"
PACKAGE_NAME="runsand_${CLEAN_VERSION}_${{ matrix.deb_arch }}.deb"
# Create package directory structure
mkdir -p "package/usr/local/bin"
mkdir -p "package/DEBIAN"
# Copy binary
cp "${BINARY_NAME}" "package/usr/local/bin/runsand"
chmod 755 "package/usr/local/bin/runsand"
# Create control file
cat > "package/DEBIAN/control" << EOF
Package: runsand
Version: ${CLEAN_VERSION}
Architecture: ${{ matrix.deb_arch }}
Maintainer: Runsand Team <info@runsand.dev>
Depends: docker.io | docker-ce
Description: Runsand Desktop Client
Desktop-as-a-Service client for accessing cloud-based development environments.
Provides secure, Solana wallet-authenticated access to containerized desktop
sessions with full SSH access and development tools.
Homepage: https://github.com/Soar-Development/runsand-installer
EOF
# Create postinst script
cat > "package/DEBIAN/postinst" << 'EOF'
#!/bin/bash
set -e
# Create user directories
if [ "$1" = "configure" ]; then
# This runs as root, but we want user dirs to be created when user runs runsand
echo "Runsand installed successfully!"
echo "Run 'sudo runsand' to get started (requires root privileges)."
fi
exit 0
EOF
chmod 755 "package/DEBIAN/postinst"
# Create prerm script
cat > "package/DEBIAN/prerm" << 'EOF'
#!/bin/bash
set -e
# Stop any running runsand processes
if [ "$1" = "remove" ]; then
pkill -f "/usr/local/bin/runsand" || true
fi
exit 0
EOF
chmod 755 "package/DEBIAN/prerm"
# Build package
dpkg-deb --build package "${PACKAGE_NAME}"
# Verify package
dpkg-deb --info "${PACKAGE_NAME}"
ls -la "${PACKAGE_NAME}"
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: runsand_${{ matrix.deb_arch }}.deb
path: runsand_*.deb
retention-days: 1
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build, package]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Prepare release assets
run: |
# Create release directory
mkdir -p release
# Show current directory structure for debugging
echo "Current directory structure:"
find . -type f -name "*runsand*" -o -name "*.deb" | head -20
# Move binaries (they should be in artifact subdirectories)
if [ -f "runsand-linux-amd64/runsand-linux-amd64" ]; then
mv runsand-linux-amd64/runsand-linux-amd64 release/
fi
if [ -f "runsand-linux-arm64/runsand-linux-arm64" ]; then
mv runsand-linux-arm64/runsand-linux-arm64 release/
fi
if [ -f "runsand-linux-armv7/runsand-linux-armv7" ]; then
mv runsand-linux-armv7/runsand-linux-armv7 release/
fi
# Move packages (find them and avoid duplicates)
find . -name "*.deb" -not -path "./release/*" -exec cp {} release/ \;
# Create checksums
cd release
if [ -n "$(ls -A .)" ]; then
sha256sum * > checksums.txt
# List all files
echo "Release files:"
ls -la
echo "Checksums:"
cat checksums.txt
else
echo "ERROR: No files found in release directory!"
exit 1
fi
- name: Generate release notes
run: |
VERSION="${{ github.event.inputs.version }}"
cat > release_notes.md << EOF
# Runsand Desktop Client ${VERSION}
## Installation
### Universal Installer (Recommended)
\`\`\`bash
curl -sSL https://raw.githubusercontent.com/Soar-Development/runsand-installer/main/install.sh | bash
\`\`\`
### Debian Package
\`\`\`bash
# AMD64
wget https://github.com/Soar-Development/runsand-installer/releases/download/${VERSION}/runsand_$(echo ${VERSION} | sed 's/v//')_amd64.deb
sudo dpkg -i runsand_*.deb
# ARM64
wget https://github.com/Soar-Development/runsand-installer/releases/download/${VERSION}/runsand_$(echo ${VERSION} | sed 's/v//')_arm64.deb
sudo dpkg -i runsand_*.deb
\`\`\`
### Manual Installation
\`\`\`bash
# Download for your architecture
wget https://github.com/Soar-Development/runsand-installer/releases/download/${VERSION}/runsand-linux-amd64
chmod +x runsand-linux-amd64
sudo mv runsand-linux-amd64 /usr/local/bin/runsand
\`\`\`
## Supported Architectures
- **Linux AMD64** (Intel/AMD 64-bit) - \`runsand-linux-amd64\`
- **Linux ARM64** (64-bit ARM) - \`runsand-linux-arm64\`
- **Linux ARMv7** (32-bit ARM) - \`runsand-linux-armv7\`
## What's New
This release includes the latest features and improvements from the main repository.
## Verification
All binaries and packages can be verified using the provided checksums:
\`\`\`bash
# Download checksums
wget https://github.com/Soar-Development/runsand-installer/releases/download/${VERSION}/checksums.txt
# Verify your download
sha256sum -c checksums.txt
\`\`\`
---
🚀 **Generated with GitHub Actions** from source repository: \`${{ github.event.inputs.source_repo }}\` @ \`${{ github.event.inputs.source_ref }}\`
EOF
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
name: Runsand Desktop Client ${{ github.event.inputs.version }}
body_path: release_notes.md
files: |
release/runsand-linux-amd64
release/runsand-linux-arm64
release/runsand-linux-armv7
release/*.deb
release/checksums.txt
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}