@@ -101,93 +101,10 @@ jobs:
101
101
with :
102
102
token : ${{ secrets.GITHUB_TOKEN }}
103
103
104
- build-binaries :
105
- name : Build binaries for ${{ matrix.os }}
106
- runs-on : ${{ matrix.os }}
107
- needs : build-and-publish
108
- permissions :
109
- contents : write
110
- strategy :
111
- matrix :
112
- include :
113
- - os : ubuntu-latest
114
- artifact_name : chaincraft-rust-linux
115
- asset_name : chaincraft-rust-linux.tar.gz
116
- features : --all-features
117
- - os : macos-latest
118
- artifact_name : chaincraft-rust-macos
119
- asset_name : chaincraft-rust-macos.tar.gz
120
- features : --all-features
121
- - os : windows-latest
122
- artifact_name : chaincraft-rust-windows
123
- asset_name : chaincraft-rust-windows.zip
124
- features : --no-default-features --features compression
125
-
126
- steps :
127
- - uses : actions/checkout@v3
128
- with :
129
- ref : ${{ github.event.release.tag_name || github.ref }}
130
-
131
- - name : Setup Rust
132
- uses : actions-rs/toolchain@v1
133
- with :
134
- profile : minimal
135
- toolchain : nightly
136
- override : true
137
- components : rustfmt, clippy
138
-
139
- - name : Install latest Cargo
140
- run : |
141
- rustup update
142
- rustup default nightly
143
- cargo --version
144
-
145
- - name : Check MacOS architecture
146
- if : matrix.os == 'macos-latest'
147
- run : |
148
- echo "MacOS architecture: $(uname -m)"
149
- echo "Rust target: $(rustc -vV | grep host)"
150
-
151
- - name : Install OpenSSL (Ubuntu)
152
- if : matrix.os == 'ubuntu-latest'
153
- run : |
154
- sudo apt-get update
155
- sudo apt-get install -y libssl-dev pkg-config
156
-
157
- - name : Install OpenSSL (macOS)
158
- if : matrix.os == 'macos-latest'
159
- run : |
160
- brew install openssl@3
161
- echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
162
- echo "OPENSSL_LIB_DIR=$(brew --prefix openssl@3)/lib" >> $GITHUB_ENV
163
- echo "OPENSSL_INCLUDE_DIR=$(brew --prefix openssl@3)/include" >> $GITHUB_ENV
164
-
165
- - name : Build binary
166
- uses : actions-rs/cargo@v1
167
- with :
168
- command : build
169
- args : --release ${{ matrix.features }}
170
-
171
- - name : Package binary (Unix)
172
- if : matrix.os != 'windows-latest'
173
- run : |
174
- tar -czf ${{ matrix.asset_name }} -C target/release chaincraft-rust
175
-
176
- - name : Package binary (Windows)
177
- if : matrix.os == 'windows-latest'
178
- run : |
179
- powershell Compress-Archive -Path target/release/chaincraft-rust.exe -DestinationPath ${{ matrix.asset_name }}
180
-
181
- - name : Upload binaries to release
182
- uses : actions/upload-artifact@v3
183
- with :
184
- name : ${{ matrix.artifact_name }}
185
- path : ${{ matrix.asset_name }}
186
-
187
104
create-release :
188
105
name : Create GitHub Release
189
106
runs-on : ubuntu-latest
190
- needs : build-binaries
107
+ needs : build-and-publish
191
108
permissions :
192
109
contents : write
193
110
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
@@ -196,19 +113,12 @@ jobs:
196
113
with :
197
114
ref : ${{ github.event.release.tag_name || github.ref }}
198
115
199
- - name : Download all artifacts
200
- uses : actions/download-artifact@v3
201
-
202
116
- name : Create GitHub Release
203
117
id : create_release
204
118
uses : softprops/action-gh-release@v1
205
119
with :
206
120
draft : false
207
121
prerelease : false
208
- files : |
209
- chaincraft-rust-linux/chaincraft-rust-linux.tar.gz
210
- chaincraft-rust-macos/chaincraft-rust-macos.tar.gz
211
- chaincraft-rust-windows/chaincraft-rust-windows.zip
212
122
body_path : CHANGELOG.md
213
123
env :
214
124
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments