Repository navigation
102 lines (97 loc) · 3.29 KB
/
Copy pathrelease.yml
File metadata and controls
102 lines (97 loc) · 3.29 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: RadByte Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
zigbuild: true
- target: aarch64-unknown-linux-musl
os: ubuntu-24.04-arm
zigbuild: true
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: release-${{ matrix.target }}
- name: Setup Zig & cargo-zigbuild
if: matrix.zigbuild
uses: mlugg/setup-zig@v2
with:
version: 0.13.0
- name: Install cargo-zigbuild
if: matrix.zigbuild
uses: taiki-e/install-action@cargo-zigbuild
- name: Build workspace (standard)
if: "!matrix.zigbuild"
env:
RADBYTE_RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }}
RADBYTE_RELEASE_REPOSITORY: ${{ github.repository }}
run: cargo build --workspace --release --locked --target ${{ matrix.target }}
- name: Build workspace (zigbuild)
if: matrix.zigbuild
env:
RADBYTE_RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }}
RADBYTE_RELEASE_REPOSITORY: ${{ github.repository }}
RUSTFLAGS: "-C target-feature=-crt-static"
run: cargo zigbuild --workspace --release --locked --target ${{ matrix.target }}
- name: Stage individual release files
run: cargo run --locked --release -p rad-tools -- stage-release ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: radbyte-${{ matrix.target }}
path: release-assets/*
if-no-files-found: error
compression-level: 0
release:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/download-artifact@v4
with:
path: release-assets
merge-multiple: true
- name: Generate grouped release downloads
env:
RELEASE_REPOSITORY: ${{ github.repository }}
RELEASE_TAG: ${{ github.ref_name }}
run: cargo run --locked --release -p rad-tools -- release-notes "$RELEASE_REPOSITORY" "$RELEASE_TAG"
- name: Publish individual files
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
fail_on_unmatched_files: true
body_path: release-notes.md
files: release-assets/*