-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (103 loc) · 3.35 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
release:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
output: catj
archive: tar.gz
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
output: catj
archive: tar.gz
# - target: arm-unknown-linux-gnueabihf
# os: ubuntu-latest
# output: catj
# archive: tar.gz
# - target: arm-unknown-linux-musleabihf
# os: ubuntu-latest
# output: catj
# archive: tar.gz
# - target: aarch64-unknown-linux-gnu
# os: ubuntu-latest
# output: catj
# archive: tar.gz
# - target: aarch64-unknown-linux-musl
# os: ubuntu-latest
# output: catj
# archive: tar.gz
steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.target }}
override: true
- name: Run Test
run: |
sudo ./init.sh $USER
export RUST_BACKTRACE=full RUST_TEST_TASK=1
cargo test
- name: Build release
uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.target }} --release
use-cross: ${{ matrix.os == 'ubuntu-latest' }}
- name: Copy and rename utility
run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }}
- name: Create archive
run: |
tar -czvf catj-${{ matrix.target }}.${{ matrix.archive }} ${{ matrix.output }}
sha256sum catj-${{ matrix.target }}.${{ matrix.archive }} > catj-${{ matrix.target }}-sha256sum.txt
- name: Upload artifacts archive
uses: actions/upload-artifact@v1
with:
name: catj-${{ matrix.target }}.${{ matrix.archive }}
path: catj-${{ matrix.target }}.${{ matrix.archive }}
- name: Upload artifacts checksum
uses: actions/upload-artifact@v1
with:
name: catj-${{ matrix.target }}-sha256sum.txt
path: catj-${{ matrix.target }}-sha256sum.txt
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
tag: ${{ github.ref }}
file: catj-${{ matrix.target }}.${{ matrix.archive }}
asset_name: catj-${{ matrix.target }}.${{ matrix.archive }}
overwrite: true
- name: Upload checksum to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
tag: ${{ github.ref }}
file: catj-${{ matrix.target }}-sha256sum.txt
asset_name: catj-${{ matrix.target }}-sha256sum.txt
overwrite: true