Skip to content

Commit bb360d3

Browse files
committed
ci: add cross-platform release workflow and docs
1 parent 005834f commit bb360d3

2 files changed

Lines changed: 125 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: write
11+
12+
env:
13+
APP_NAME: dustrown
14+
15+
jobs:
16+
build:
17+
name: Build ${{ matrix.target }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- os: ubuntu-24.04
24+
target: x86_64-unknown-linux-gnu
25+
artifact_name: dustrown-linux-x86_64
26+
archive_name: dustrown-linux-x86_64.tar.gz
27+
- os: windows-2022
28+
target: x86_64-pc-windows-msvc
29+
artifact_name: dustrown-windows-x86_64
30+
archive_name: dustrown-windows-x86_64.zip
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Install Rust toolchain
37+
uses: dtolnay/rust-toolchain@stable
38+
with:
39+
targets: ${{ matrix.target }}
40+
41+
- name: Cache Cargo
42+
uses: Swatinem/rust-cache@v2
43+
44+
- name: Install Linux dependencies
45+
if: runner.os == 'Linux'
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y \
49+
libgtk-3-dev \
50+
libwebkit2gtk-4.1-dev \
51+
libsoup-3.0-dev
52+
53+
- name: Build release binary
54+
run: cargo build --release --locked --target ${{ matrix.target }}
55+
56+
- name: Package Linux artifact
57+
if: runner.os == 'Linux'
58+
run: |
59+
mkdir -p dist
60+
cp "target/${{ matrix.target }}/release/${APP_NAME}" dist/
61+
cp README.md dist/
62+
tar -C dist -czf "${{ matrix.archive_name }}" "${APP_NAME}" README.md
63+
64+
- name: Package Windows artifact
65+
if: runner.os == 'Windows'
66+
shell: pwsh
67+
run: |
68+
New-Item -ItemType Directory -Force -Path dist | Out-Null
69+
Copy-Item "target/${{ matrix.target }}/release/${env:APP_NAME}.exe" -Destination dist/
70+
Copy-Item "README.md" -Destination dist/
71+
Compress-Archive -Path "dist/${env:APP_NAME}.exe", "dist/README.md" -DestinationPath "${{ matrix.archive_name }}"
72+
73+
- name: Upload build artifact
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: ${{ matrix.artifact_name }}
77+
path: ${{ matrix.archive_name }}
78+
79+
release:
80+
name: Publish GitHub release
81+
if: startsWith(github.ref, 'refs/tags/v')
82+
runs-on: ubuntu-24.04
83+
needs: build
84+
steps:
85+
- name: Download Linux artifact
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: dustrown-linux-x86_64
89+
path: release-assets
90+
91+
- name: Download Windows artifact
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: dustrown-windows-x86_64
95+
path: release-assets
96+
97+
- name: Create GitHub release
98+
uses: softprops/action-gh-release@v2
99+
with:
100+
files: |
101+
release-assets/*.tar.gz
102+
release-assets/*.zip

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,26 @@ Package names vary by distribution.
5353
## Notes for i3/minimal WMs
5454

5555
Menus are rendered inside the app window and do not depend on desktop/global menu integrations.
56+
57+
## GitHub Actions Release Pipeline
58+
59+
This repository includes a cross-platform release workflow at `.github/workflows/release.yml`.
60+
61+
- Builds release artifacts for:
62+
- Linux `x86_64-unknown-linux-gnu`
63+
- Windows `x86_64-pc-windows-msvc`
64+
- Trigger options:
65+
- push a tag matching `v*` (for example `v0.2.0`)
66+
- run manually with GitHub Actions `workflow_dispatch`
67+
- Release artifacts produced:
68+
- `dustrown-linux-x86_64.tar.gz`
69+
- `dustrown-windows-x86_64.zip`
70+
71+
### Create a tagged release
72+
73+
```bash
74+
git tag v0.2.0
75+
git push origin v0.2.0
76+
```
77+
78+
When the tag workflow completes, GitHub Release assets are attached automatically.

0 commit comments

Comments
 (0)