@@ -18,141 +18,41 @@ env:
18
18
CARGO_TERM_COLOR : always
19
19
20
20
jobs :
21
- build-cross :
21
+ create-release :
22
22
runs-on : ubuntu-latest
23
- env :
24
- RUST_BACKTRACE : full
25
- strategy :
26
- fail-fast : false
27
- matrix :
28
- target :
29
- - i686-unknown-linux-musl
30
- - x86_64-pc-windows-gnu
31
- - x86_64-unknown-linux-gnu
32
- - x86_64-unknown-linux-musl
33
- - armv7-unknown-linux-musleabihf
34
- - armv7-unknown-linux-gnueabihf
35
- - arm-unknown-linux-gnueabi
36
- - arm-unknown-linux-gnueabihf
37
- - arm-unknown-linux-musleabi
38
- - arm-unknown-linux-musleabihf
39
- - aarch64-unknown-linux-gnu
40
- - aarch64-unknown-linux-musl
41
- - mips-unknown-linux-musl
42
- - mips-unknown-linux-gnu
43
- - mipsel-unknown-linux-musl
44
-
45
23
steps :
46
24
- uses : actions/checkout@v3
47
-
48
- - name : Install Rust
49
- run : |
50
- rustup set profile minimal
51
- rustup toolchain install stable
52
- rustup default stable
53
- rustup override set stable
54
- rustup target add --toolchain stable ${{ matrix.target }}
55
-
56
- - name : Install cross
57
- run : cargo install cross
58
-
59
- - name : Build ${{ matrix.target }}
60
- timeout-minutes : 120
61
- run : |
62
- compile_target=${{ matrix.target }}
63
-
64
- if [[ "$compile_target" == *"-linux-"* || "$compile_target" == *"-apple-"* ]]; then
65
- compile_features="-f local-redir -f local-tun"
66
- fi
67
-
68
- if [[ "$compile_target" == "mips-"* || "$compile_target" == "mipsel-"* || "$compile_target" == "mips64-"* || "$compile_target" == "mips64el-"* ]]; then
69
- sudo apt-get update -y && sudo apt-get install -y upx;
70
- if [[ "$?" == "0" ]]; then
71
- compile_compress="-u"
72
- fi
73
- fi
74
-
75
- cd build
76
- ./build-release -t ${{ matrix.target }} $compile_features $compile_compress
77
-
78
- - name : Upload Github Assets
79
- uses : softprops/action-gh-release@v1
80
- env :
81
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
+ - uses : taiki-e/create-gh-release-action@v1
82
26
with :
83
- files : build/release/*
84
- prerelease : ${{ contains(github.ref_name, '-') }}
85
- tag_name : ${{ inputs.tag || github.ref_name }}
27
+ # (optional) Path to changelog.
28
+ # changelog: CHANGELOG.md
29
+ # (required) GitHub token for creating GitHub Releases.
30
+ token : ${{ secrets.GITHUB_TOKEN }}
86
31
87
- build-unix :
88
- runs-on : ${{ matrix.os }}
89
- env :
90
- BUILD_EXTRA_FEATURES : " local-redir local-tun"
91
- RUST_BACKTRACE : full
32
+ upload-assets :
92
33
strategy :
93
- fail-fast : false
94
34
matrix :
95
- # os: [ubuntu-latest, macos-latest]
96
- os : [macos-latest]
97
- target :
98
- - x86_64-apple-darwin
99
- - aarch64-apple-darwin
100
- steps :
101
- - uses : actions/checkout@v3
102
-
103
- - name : Install GNU tar
104
- if : runner.os == 'macOS'
105
- run : |
106
- brew install gnu-tar
107
- # echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
108
- echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
109
-
110
- - name : Install Rust
111
- run : |
112
- rustup set profile minimal
113
- rustup toolchain install stable
114
- rustup default stable
115
- rustup override set stable
116
- rustup target add --toolchain stable ${{ matrix.target }}
117
-
118
- - name : Build release
119
- shell : bash
120
- run : |
121
- ./build/build-host-release -t ${{ matrix.target }}
122
-
123
- - name : Upload Github Assets
124
- uses : softprops/action-gh-release@v1
125
- env :
126
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
127
- with :
128
- files : build/release/*
129
- prerelease : ${{ contains(github.ref_name, '-') }}
130
- tag_name : ${{ inputs.tag || github.ref_name }}
131
-
132
- build-windows :
133
- runs-on : windows-latest
134
- env :
135
- RUSTFLAGS : " -C target-feature=+crt-static"
136
- RUST_BACKTRACE : full
35
+ include :
36
+ - target : aarch64-unknown-linux-gnu
37
+ os : ubuntu-latest
38
+ - target : aarch64-apple-darwin
39
+ os : macos-latest
40
+ - target : x86_64-unknown-linux-gnu
41
+ os : ubuntu-latest
42
+ - target : x86_64-apple-darwin
43
+ os : macos-latest
44
+ # Universal macOS binary is supported as universal-apple-darwin.
45
+ - target : universal-apple-darwin
46
+ os : macos-latest
47
+ runs-on : ${{ matrix.os }}
137
48
steps :
138
49
- uses : actions/checkout@v3
139
-
140
- - name : Install Rust
141
- run : |
142
- rustup set profile minimal
143
- rustup toolchain install stable
144
- rustup default stable
145
- rustup override set stable
146
-
147
- - name : Build release
148
- run : |
149
- pwsh ./build/build-host-release.ps1
150
-
151
- - name : Upload Github Assets
152
- uses : softprops/action-gh-release@v1
153
- env :
154
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50
+ - uses : taiki-e/upload-rust-binary-action@v1
155
51
with :
156
- files : build/release/*
157
- prerelease : ${{ contains(github.ref_name, '-') }}
158
- tag_name : ${{ inputs.tag || github.ref_name }}
52
+ # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
53
+ # Note that glob pattern is not supported yet.
54
+ bin : kaput
55
+ # (optional) Target triple, default is host triple.
56
+ target : ${{ matrix.target }}
57
+ # (required) GitHub token for uploading assets to GitHub Releases.
58
+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments