-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (72 loc) · 2.31 KB
/
Copy pathrelease.yml
File metadata and controls
88 lines (72 loc) · 2.31 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
# Build release binaries on tag push and attach them to a GitHub Release.
# Targets: macOS arm64, macOS x86_64, Linux x86_64, Linux arm64.
# All free via GitHub Actions — no external services.
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS arm64
os: macos-latest
target: aarch64-apple-darwin
- name: macOS x86_64
os: macos-latest
target: x86_64-apple-darwin
- name: Linux x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: Linux arm64
os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: "agent\nserver"
- name: Build agent
run: cargo build --release --manifest-path agent/Cargo.toml --target ${{ matrix.target }}
- name: Build server
run: cargo build --release --manifest-path server/Cargo.toml --target ${{ matrix.target }}
- name: Package
run: |
mkdir -p dist
for bin in tokenhud-agent tokenhud-server; do
src="agent/target/${{ matrix.target }}/release/${bin}"
[ ! -f "$src" ] && src="server/target/${{ matrix.target }}/release/${bin}"
artifact="${bin}-${{ matrix.target }}"
cp "$src" "dist/${artifact}"
chmod +x "dist/${artifact}"
shasum -a 256 "dist/${artifact}" > "dist/${artifact}.sha256"
done
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.target }}
path: dist/
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: artifacts/*