-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.47 KB
/
release.yml
File metadata and controls
56 lines (46 loc) · 1.47 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
name: Release Binary
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-and-release:
name: Build & Publish Release
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
arch: amd64
- target: aarch64-unknown-linux-musl
arch: aarch64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup target add ${{ matrix.target }}
- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- name: Install cargo-zigbuild
run: cargo install cargo-zigbuild
- name: Build with cargo-zigbuild
run: cargo zigbuild --release --target ${{ matrix.target }}
env:
cargo_build_version: ${{ github.event.release.tag_name }}
- name: Create Release Package
run: |
DIST_DIR="dn42-autopeer-daemon-${{ matrix.arch }}"
mkdir -p "$DIST_DIR"
cp "target/${{ matrix.target }}/release/dn42-autopeer-daemon" "$DIST_DIR/"
cp "config.toml" "$DIST_DIR/"
cp "dn42-autopeer-daemon.service" "$DIST_DIR/"
tar -czvf "${DIST_DIR}.tar.gz" "$DIST_DIR"
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: dn42-autopeer-daemon-${{ matrix.arch }}.tar.gz