Skip to content

Commit df8ddcb

Browse files
committed
ci: add workflow to build and release binaries
Added GitHub Actions workflow to automatically build binaries when releases are published by release-plz. Platforms supported (10 total): - Linux: x86_64/aarch64 (gnu and musl variants) - macOS: x86_64/aarch64 (Intel and Apple Silicon) - Windows: x86_64/aarch64 Features: - Triggers on GitHub release published event - Manual trigger with tag input for existing releases - Cross-compilation using taiki-e/upload-rust-binary-action - Workspace-aware with manifest-path to crates/ccsync - Archives: .tar.gz for Unix, .zip for Windows - Uploads binaries directly to GitHub release Usage: - Automatic: Push to master → release-plz creates release → binaries built - Manual: Actions → Release Binaries → Run workflow → Enter tag This enables users to download pre-built binaries instead of building from source.
1 parent 0a4fedc commit df8ddcb

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release Binaries
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag to build binaries for (e.g., v0.1.3)'
10+
required: true
11+
type: string
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
upload-binaries:
18+
name: Build and upload binaries
19+
# Build binaries for all releases (workspace uses single version)
20+
if: github.repository_owner == 'onsails'
21+
strategy:
22+
matrix:
23+
include:
24+
# Linux
25+
- target: x86_64-unknown-linux-gnu
26+
os: ubuntu-latest
27+
- target: aarch64-unknown-linux-gnu
28+
os: ubuntu-latest
29+
- target: x86_64-unknown-linux-musl
30+
os: ubuntu-latest
31+
- target: aarch64-unknown-linux-musl
32+
os: ubuntu-latest
33+
34+
# macOS
35+
- target: x86_64-apple-darwin
36+
os: macos-latest
37+
- target: aarch64-apple-darwin
38+
os: macos-latest
39+
40+
# Windows
41+
- target: x86_64-pc-windows-msvc
42+
os: windows-latest
43+
- target: aarch64-pc-windows-msvc
44+
os: windows-latest
45+
46+
runs-on: ${{ matrix.os }}
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.event.inputs.tag || github.ref }}
53+
54+
- name: Install Rust toolchain
55+
uses: dtolnay/rust-toolchain@stable
56+
57+
- name: Upload binary to release
58+
uses: taiki-e/upload-rust-binary-action@v1
59+
with:
60+
bin: ccsync
61+
manifest-path: crates/ccsync/Cargo.toml
62+
target: ${{ matrix.target }}
63+
tar: all
64+
zip: windows
65+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)