-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (94 loc) · 3.01 KB
/
releases.yml
File metadata and controls
101 lines (94 loc) · 3.01 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
name: Release
on:
workflow_dispatch:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
jobs:
build_artifacts:
name: Build for ${{ matrix.os_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os_name: FreeBSD-x86_64
os: ubuntu-latest
target: x86_64-unknown-freebsd
- os_name: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os_name: Linux-aarch64
os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os_name: Linux-arm
os: ubuntu-latest
target: arm-unknown-linux-musleabi
- os_name: Linux-riscv64
os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
- os_name: Windows-aarch64
os: windows-latest
target: aarch64-pc-windows-msvc
ext: ".exe"
- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
ext: ".exe"
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v5
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.name, 'musl')
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.target }}
toolchain: stable
args: "--locked --release"
strip: true
- name: Rename Artifacts
shell: bash
run: |
APP_NAME=tracker
ver=${GITHUB_REF#refs/tags/}
ASSET_PATH=$APP_NAME-$ver-${{ matrix.target }}${{ matrix.ext }}
mv target/${{ matrix.target }}/release/$APP_NAME $ASSET_PATH
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v5
with:
name: ${{ env.ASSET_PATH }}
path: ${{ env.ASSET_PATH }}
create_release:
name: Create GitHub Release
needs: build_artifacts
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: ./artifacts
- name: List downloaded files (debug)
run: ls -R ./artifacts
- name: Generate Release Body
run: |
cargo install git-cliff --locked
git-cliff --latest --strip all | sed 1,2d > RELEASE.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ./artifacts/**/*
body_path: RELEASE.md
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}