-
-
Notifications
You must be signed in to change notification settings - Fork 23
86 lines (74 loc) · 2.87 KB
/
wolfscale-release.yml
File metadata and controls
86 lines (74 loc) · 2.87 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
name: WolfScale — Build Release Binaries
on:
push:
branches: [main]
paths:
- 'Cargo.toml'
- 'src/**'
- '.github/workflows/wolfscale-release.yml'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
arch: x86_64
runner: ubuntu-latest
- target: aarch64-unknown-linux-musl
arch: aarch64
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build static binaries
run: cross build --release --target ${{ matrix.target }} --bin wolfscale --bin wolfctl
- name: Package binaries
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/wolfscale dist/wolfscale-${{ matrix.arch }}
cp target/${{ matrix.target }}/release/wolfctl dist/wolfctl-${{ matrix.arch }}
chmod +x dist/wolfscale-${{ matrix.arch }} dist/wolfctl-${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wolfscale-${{ matrix.arch }}
path: dist/*
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Get version
id: version
run: echo "version=$(grep '^version' Cargo.toml | head -1 | sed 's/.*\"\(.*\)\".*/\1/')" >> "$GITHUB_OUTPUT"
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
# Rolling 'wolfscale-latest' release so consumers (WolfStack's cluster
# builder, setup.sh) have a STABLE download URL. The WolfScale repo also
# ships WolfDisk releases, so a plain 'latest' would be ambiguous — this
# tag is deleted + recreated on every build.
- name: Publish rolling 'wolfscale-latest' release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete "wolfscale-latest" --yes --cleanup-tag 2>/dev/null || true
git push --delete origin "wolfscale-latest" 2>/dev/null || true
gh release create "wolfscale-latest" \
--title "WolfScale (latest — ${{ steps.version.outputs.version }})" \
--notes "Prebuilt static WolfScale + wolfctl binaries for Linux x86_64 and aarch64 (ARM64/Raspberry Pi 4+). Rolling 'latest' tag, rebuilt on every push to main. Built from version ${{ steps.version.outputs.version }}." \
dist/wolfscale-x86_64 \
dist/wolfscale-aarch64 \
dist/wolfctl-x86_64 \
dist/wolfctl-aarch64