-
Notifications
You must be signed in to change notification settings - Fork 14
110 lines (100 loc) · 3.26 KB
/
release.yaml
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
name: release
on:
workflow_dispatch: { }
push:
tags:
- '*'
defaults:
run:
shell: bash
jobs:
all:
name: All
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-musl
- armv7-unknown-linux-musleabihf
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-musl
include:
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
native: false
target_rustflags: '--codegen linker=aarch64-linux-gnu-gcc'
- target: armv7-unknown-linux-musleabihf
os: ubuntu-latest
native: false
target_rustflags: '--codegen linker=arm-linux-gnueabihf-gcc'
- target: x86_64-apple-darwin
os: macos-latest
native: true
target_rustflags: ''
- target: x86_64-pc-windows-msvc
os: windows-2016
native: true
target_rustflags: ''
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
native: true
target_rustflags: ''
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Install Rust Toolchain Components
uses: actions-rs/toolchain@v1
with:
override: true
target: ${{ matrix.target }}
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Install AArch64 Toolchain
if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }}
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
echo "TARGET_CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
- name: Install ARM7 Toolchain
if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }}
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
echo "TARGET_CC=arm-linux-gnueabihf-gcc" >> "$GITHUB_ENV"
- name: Test
if: matrix.native
run: |
env
cargo test --all --target ${{ matrix.target }}
- name: Package
id: package
env:
TARGET: ${{ matrix.target }}
REF: ${{ github.ref }}
OS: ${{ matrix.os }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
run: ./.github/package
shell: bash
- name: Publish Archive
uses: softprops/[email protected]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: false
files: ${{ steps.package.outputs.archive }}
prerelease: ${{ contains(github.ref_name, '-') }} ## looking for a bare semver number rather than a tagged one like 1.0.0-beta.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Changelog
uses: softprops/[email protected]
if: >-
${{
startsWith(github.ref, 'refs/tags/')
&& matrix.target == 'x86_64-unknown-linux-musl'
}}
with:
draft: false
files: CHANGELOG.md
prerelease: ${{ contains(github.ref_name, '-') }} ## looking for a bare semver number rather than a tagged one like 1.0.0-beta.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}