Skip to content

Commit 9e1a7c0

Browse files
Emperiusmclaude
andcommitted
ci: add release workflow — build & publish binaries on version tags
Triggers on v* tags. Builds --release server + client on Windows, zips with README + LICENSE, creates GitHub Release with changelog. Pre-release flag auto-set for -rc/-beta/-alpha tags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a12e426 commit 9e1a7c0

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
name: Build & Release
13+
runs-on: windows-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: dtolnay/rust-toolchain@stable
18+
19+
- uses: Swatinem/rust-cache@v2
20+
with:
21+
key: release
22+
23+
- name: Build release binaries
24+
run: cargo build --release -p prism-server -p prism-client
25+
26+
- name: Prepare artifacts
27+
shell: pwsh
28+
run: |
29+
$version = "${{ github.ref_name }}"
30+
$dir = "prism-$version-windows-x64"
31+
New-Item -ItemType Directory -Path $dir
32+
Copy-Item target/release/prism-server.exe $dir/
33+
Copy-Item target/release/prism-client.exe $dir/
34+
Copy-Item README.md $dir/
35+
Copy-Item LICENSE $dir/
36+
Compress-Archive -Path $dir/* -DestinationPath "$dir.zip"
37+
echo "ARTIFACT=$dir.zip" >> $env:GITHUB_ENV
38+
echo "VERSION=$version" >> $env:GITHUB_ENV
39+
40+
- name: Generate changelog
41+
id: changelog
42+
shell: pwsh
43+
run: |
44+
# Get commits since last tag
45+
$prevTag = git describe --tags --abbrev=0 HEAD^ 2>$null
46+
if ($prevTag) {
47+
$log = git log --pretty=format:"- %s" "$prevTag..HEAD" -- ':!.github'
48+
} else {
49+
$log = git log --pretty=format:"- %s" -20
50+
}
51+
$body = @"
52+
## What's Changed
53+
54+
$($log -join "`n")
55+
56+
## Downloads
57+
58+
| File | Description |
59+
|------|-------------|
60+
| ``prism-${{ github.ref_name }}-windows-x64.zip`` | Server + Client binaries (Windows x64) |
61+
62+
### Quick Start
63+
64+
```bash
65+
# Extract and run
66+
prism-server.exe --dda # Start server (real desktop capture)
67+
prism-client.exe # Open launcher
68+
prism-client.exe 192.168.1.100:7000 # Direct connect
69+
```
70+
"@
71+
# Write to file to avoid escaping issues
72+
$body | Out-File -FilePath changelog.md -Encoding utf8
73+
74+
- name: Create GitHub Release
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
body_path: changelog.md
78+
files: ${{ env.ARTIFACT }}
79+
draft: false
80+
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}

0 commit comments

Comments
 (0)