forked from NOBLES5E/cproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (96 loc) · 3.13 KB
/
build-and-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
on:
workflow_dispatch:
release:
types: [published]
name: build-and-release
jobs:
build-and-release:
strategy:
fail-fast: false
matrix:
include:
# x86_64-linux-gnu
- arch-name: x86_64-linux-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cross: false
file-ext:
# x86_64-linux-musl
- arch-name: x86_64-linux-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
cross: true
file-ext:
# aarch64-linux-gnu
- arch-name: aarch64-linux-gnu
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
cross: true
file-ext:
# aarch64-linux-musl
- arch-name: aarch64-linux-musl
os: ubuntu-latest
target: aarch64-unknown-linux-musl
cross: true
file-ext:
# arm-unknown-linux-gnueabi
- arch-name: arm-linux-gnueabi
os: ubuntu-latest
target: arm-unknown-linux-gnueabi
cross: true
file-ext:
# arm-unknown-linux-gnueabihf
- arch-name: arm-linux-gnueabihf
os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
cross: true
file-ext:
# riscv64gc-linux-gnu
- arch-name: riscv64gc-linux-gnu
os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
cross: true
file-ext:
# riscv64gc-linux-musl
- arch-name: riscv64gc-linux-musl
os: ubuntu-latest
target: riscv64gc-unknown-linux-musl
cross: true
file-ext:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get the latest tag
id: tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --target ${{ matrix.target }}
- name: Move binaries
run: |
mkdir artifacts/
mv target/${{ matrix.target }}/release/cproxy${{ matrix.file-ext }} artifacts/cproxy-${{ steps.tag.outputs.tag }}-${{ matrix.arch-name }}${{ matrix.file-ext }}
- name: Calculate SHA256
run: |
cd artifacts/
openssl dgst -sha256 -r cproxy-${{ steps.tag.outputs.tag }}-${{ matrix.arch-name }}${{ matrix.file-ext }} > cproxy-${{ steps.tag.outputs.tag }}-${{ matrix.arch-name }}${{ matrix.file-ext }}.sha256sum
- name: Release binaries
uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/*"
tag: ${{ steps.tag.outputs.tag }}
name: ${{ steps.tag.outputs.tag }}
allowUpdates: true
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}