-
Notifications
You must be signed in to change notification settings - Fork 28
124 lines (101 loc) · 3.55 KB
/
release.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Release
permissions:
contents: write
on:
workflow_dispatch:
push:
tags:
- v[0-9]+.*
jobs:
release-linux-musl-amd64:
name: Release for Linux/amd64/musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- name: Install Musl dev tools
run: sudo apt-get update && sudo apt-get install musl-dev musl-tools
- run: cargo build --release --target x86_64-unknown-linux-musl
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: target/x86_64-unknown-linux-musl/release/dash-mpd-cli
asset_name: dash-mpd-cli-linux-amd64
overwrite: true
release-linux-aarch64:
name: Release for Linux/aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu
- name: Install GCC cross-compiler for aarch64
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu
- run: |
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
cargo build --release --target aarch64-unknown-linux-gnu
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: target/aarch64-unknown-linux-gnu/release/dash-mpd-cli
asset_name: dash-mpd-cli-linux-aarch64
overwrite: true
# Some of the GitHub MacOS runners (M1 processor) do not support nested virtualization, so can't
# run Docker/Podman in a VM. Since we want to use the Docker image for cargo-zigbuild to be able
# to build a universal binary, we cross-compile from a ubuntu-latest runner.
release-macos:
name: Release universal binary for MacOS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
podman pull docker.io/messense/cargo-zigbuild
podman run --rm \
-v ${GITHUB_WORKSPACE}:/io \
-w /io docker.io/messense/cargo-zigbuild \
cargo zigbuild --release --target universal2-apple-darwin
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: target/universal2-apple-darwin/release/dash-mpd-cli
asset_name: dash-mpd-cli-macos
overwrite: true
release-windows:
name: Release for Windows/amd64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: base-devel autotools mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-rust mingw-w64-ucrt-x86_64-gcc
- run: cargo build --release
shell: msys2 {0}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: target/release/dash-mpd-cli.exe
asset_name: dash-mpd-cli-windows.exe
overwrite: true