Skip to content

Commit ed39e25

Browse files
committed
lets try this
1 parent 99315f9 commit ed39e25

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/release-binaries.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,61 @@ on:
99
permissions:
1010
contents: write
1111

12+
env:
13+
CRATE_PATH: ./script
14+
BIN_NAME: genesis
15+
1216
jobs:
17+
linux:
18+
runs-on: ubuntu-22.04
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: dtolnay/rust-toolchain@stable
26+
with:
27+
targets: ${{ matrix.target }}
28+
29+
# Make sure we have modern C++17 cross compilers on Linux
30+
- name: Install modern GCC for C++17
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y gcc-13 g++-13 gcc-13-aarch64-linux-gnu g++-13-aarch64-linux-gnu
34+
35+
- name: Build (release)
36+
working-directory: ${{ env.CRATE_PATH }}
37+
env:
38+
CC_x86_64_unknown_linux_gnu: gcc-13
39+
CXX_x86_64_unknown_linux_gnu: g++-13
40+
CXXFLAGS_x86_64_unknown_linux_gnu: -std=gnu++17
41+
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc-13
42+
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++-13
43+
CXXFLAGS_aarch64_unknown_linux_gnu: -std=gnu++17
44+
run: |
45+
cargo build --bin ${BIN_NAME} --release --target ${{ matrix.target }}
46+
47+
- name: Package artifact
48+
run: |
49+
set -euo pipefail
50+
VERSION="${GITHUB_REF_NAME#v}"
51+
TARGET="${{ matrix.target }}"
52+
BIN="${{ env.CRATE_PATH }}/target/${TARGET}/release/${{ env.BIN_NAME }}"
53+
OUT=dist && mkdir -p "$OUT"
54+
# strip if available
55+
(strip "$BIN" || true) 2>/dev/null || true
56+
PKG="${{ env.BIN_NAME }}-${VERSION}-${TARGET}.tar.gz"
57+
tar -czf "${OUT}/${PKG}" -C "$(dirname "$BIN")" "$(basename "$BIN")"
58+
(cd "$OUT" && shasum -a 256 "$PKG" > "${PKG}.sha256")
59+
60+
- name: Upload to Release
61+
uses: softprops/action-gh-release@v2
62+
with:
63+
tag_name: ${{ github.ref_name }}
64+
files: |
65+
dist/*.tar.gz
66+
dist/*.sha256
1367
build-and-release:
1468
name: Build & Release (multi-target)
1569
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)