-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (93 loc) · 2.96 KB
/
publish.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
name: Publish
on:
push:
tags:
- '*'
jobs:
build:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
binary_target: x86_64-unknown-linux-musl
profile: release+static+x86_64
needs_musl: true
- os: ubuntu-20.04
binary_target: aarch64-unknown-linux-musl
profile: release+static+aarch64
needs_musl: true
- os: windows-2019
binary_target: x86_64-pc-windows-msvc
profile: release+windows
- os: macos-11
binary_target: x86_64-apple-darwin
profile: release+mac_intel
- os: macos-11
binary_target: aarch64-apple-darwin
profile: release+mac_arm
steps:
- name: Install musl tools
if: matrix.needs_musl
run: >-
sudo apt-get update &&
sudo apt-get install
clang
llvm
musl-tools
gcc-aarch64-linux-gnu
g++-aarch64-linux-gnu
binutils-aarch64-linux-gnu
qemu-user
- name: Checkout
uses: actions/checkout@v2
- name: Install rust for target ${{ matrix.binary_target }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.binary_target }}
profile: minimal
- uses: davidB/rust-cargo-make@v1
- name: Get tag
id: get_tag
shell: bash
run: echo ::set-output name=tag::${GITHUB_REF##refs/tags/}
- name: Build Binary
shell: bash
run: |
cargo make \
--profile ${{ matrix.profile }} \
--env CARGO_MAKE_PROJECT_VERSION=${{ steps.get_tag.outputs.tag }} \
zip-release-ci-flow
- name: Upload Binaries
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
overwrite: true
file_glob: true
post-build:
name: Post Build
runs-on: ubuntu-20.04
needs: [ build ]
steps:
- name: Get tag
id: get_tag
shell: bash
run: echo ::set-output name=tag::${GITHUB_REF##refs/tags/}
- name: Hook into package registry
uses: swift-nav/swift-cli-publisher@v2
env:
DL_LINUX_x86_64: "ntripping-${{ steps.get_tag.outputs.tag }}-x86_64-unknown-linux-musl.zip"
DL_LINUX_aarch64: "ntripping-${{ steps.get_tag.outputs.tag }}-aarch64-unknown-linux-musl.zip"
DL_MAC_x86_64: "ntripping-${{ steps.get_tag.outputs.tag }}-x86_64-apple-darwin.zip"
DL_MAC_aarch64: "ntripping-${{ steps.get_tag.outputs.tag }}-aarch64-apple-darwin.zip"
DL_WIN: "ntripping-${{ steps.get_tag.outputs.tag }}-x86_64-pc-windows-msvc.zip"
TOOLS: "ntripping"
with:
token: ${{ secrets.GH_TOKEN }}
gh-name: ${{ secrets.GH_NAME }}
gh-email: ${{ secrets.GH_EMAIL }}