1
1
# https://github.com/svenstaro/proxyboi/blob/fd1b493d2c2a341205d669cbf6bd549c5731df63/.github/workflows/publish.yml
2
2
3
3
on :
4
- push :
5
- tags :
6
- - ' v*.*.* '
4
+ release :
5
+ # Only use the types keyword to narrow down the activity types that will trigger your workflow.
6
+ types : [published, created, edited]
7
7
8
8
name : Publish
9
9
10
10
jobs :
11
- publish :
11
+ normal-compile- publish :
12
12
name : Publish
13
13
runs-on : ${{ matrix.os }}
14
14
strategy :
15
15
matrix :
16
16
os : [ubuntu-latest, windows-latest, macos-latest]
17
17
include :
18
18
- os : ubuntu-latest
19
- artifact_name : crypto-learn -backend
20
- release_name : crypto-learn -backend-linux-amd64
19
+ artifact_name : cryptography-learning -backend
20
+ release_name : cryptography-learning -backend-linux-ubuntu -amd64
21
21
- os : windows-latest
22
- artifact_name : crypto-learn -backend.exe
23
- release_name : crypto-learn -backend-windows-amd64.exe
22
+ artifact_name : cryptography-learning -backend.exe
23
+ release_name : cryptography-learning -backend-windows-amd64.exe
24
24
- os : macos-latest
25
- artifact_name : crypto-learn -backend
26
- release_name : crypto-learn -backend-macos-amd64
25
+ artifact_name : cryptography-learning -backend
26
+ release_name : cryptography-learning -backend-macos-amd64
27
27
28
28
steps :
29
29
- uses : actions/checkout@v2
30
-
31
30
- uses : actions-rs/toolchain@v1
32
31
with :
33
32
toolchain : stable
34
33
target : ${{ matrix.target }}
35
34
override : true
36
-
37
35
- uses : actions-rs/cargo@v1
38
36
with :
39
37
use-cross : true
40
38
command : build
41
39
args : --release
42
-
43
40
- name : Upload binaries to release
44
41
uses : svenstaro/upload-release-action@v1-release
45
42
with :
48
45
asset_name : ${{ matrix.release_name }}
49
46
tag : ${{ github.ref }}
50
47
51
- cross_compile_publish :
48
+ cross-compile-publish :
52
49
name : Cross compile publish
53
50
runs-on : ubuntu-latest
54
51
strategy :
71
68
uses : svenstaro/upload-release-action@v1-release
72
69
with :
73
70
repo_token : ${{ secrets.GITHUB_TOKEN }}
74
- file : target/${{ matrix.target }}/release/crypto-learn-backend
75
- asset_name : crypto-learn-backend-${{ matrix.target }}
76
- tag : ${{ github.ref }}
71
+ file : target/${{ matrix.target }}/release/cryptography-learning-backend
72
+ asset_name : cryptography-learning-backend-${{ matrix.target }}
73
+ tag : ${{ github.ref }}
74
+
75
+ static-compile-publish :
76
+ name : Static build publish on Linux
77
+ runs-on : ubuntu-latest
78
+ env :
79
+ CARGO_TERM_COLOR : always
80
+ BUILD_TARGET : x86_64-unknown-linux-musl
81
+ BINARY_NAME : cryptography-learning-backend-x86_64-linux-unknown-musl
82
+ steps :
83
+ - uses : actions/checkout@v2
84
+ - name : Static build
85
+ uses : gmiam/rust-musl-action@master
86
+ with :
87
+ args : cargo build --target $BUILD_TARGET --release
88
+ - uses : svenstaro/upload-release-action@v1-release
89
+ with :
90
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
91
+ file : target/${{ env.BUILD_TARGET }}/release/cryptography-learning-backend
92
+ asset_name : ${{ env.BINARY_NAME }}
93
+ tag : ${{ github.ref }}
94
+
0 commit comments