-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (81 loc) · 2.78 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
name: Release
on:
push:
tags: ["[0-9].[0-9]+.[0-9]+"]
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: false
generate_release_notes: false
prerelease: false
files: |
LICENSE
populate_release:
runs-on: ${{ matrix.os }}
needs: create_release
strategy:
matrix:
target:
- aarch64-apple-ios
- aarch64-linux-android
- aarch64-apple-darwin
- aarch64-unknown-linux-gnu
- aarch64-pc-windows-msvc
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
include:
- target: aarch64-apple-ios
os: macos-latest
binary: ctrl
- target: aarch64-linux-android
os: ubuntu-latest
binary: ctrl
- target: aarch64-apple-darwin
os: macos-latest
binary: ctrl
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
binary: ctrl
- target: aarch64-pc-windows-msvc
os: windows-latest
binary: ctrl.exe
- target: x86_64-apple-darwin
os: macos-latest
binary: ctrl
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
binary: ctrl
- target: x86_64-pc-windows-msvc
os: windows-latest
binary: ctrl.exe
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set NDK linker path [Android (aarch64)]
run: echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
if: ${{ matrix.target == 'aarch64-linux-android' }}
- name: Install GNU GCC [Linux (aarch64)]
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
- name: Rust target add
run: rustup target add ${{ matrix.target }}
- name: Cargo build release
# specifying --target is required for Rust linker
# when cross compiling, static linking, building stdlib from source, etc
# https://github.com/rust-lang/rust/issues/78210
run: cargo build --release --target=${{ matrix.target }}
- name: Rename binary
run: mv ${{ matrix.binary }} ${{ matrix.target }}-${{ matrix.binary }}
working-directory: target/${{ matrix.target }}/release
- name: Copy binary into release
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/${{ matrix.target }}-${{ matrix.binary }}