-
Notifications
You must be signed in to change notification settings - Fork 22
275 lines (245 loc) · 9.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
name: Release
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
# continue even though build failed for one or more targets
continue-on-error: true
env:
CARGO: cargo
# Emit backtraces on panics.
RUST_BACKTRACE: 1
strategy:
fail-fast: false
matrix:
include:
- build: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
- build: macos
os: macos-latest
rust: stable
target: aarch64-apple-darwin
- build: win64-msvc
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: UBX2RNX Dependencies
if: matrix.build == 'linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev
- name: Build applications
shell: bash
run: |
CARGO_PROFILE_RELEASE_STRIP=symbols ${{ env.CARGO }} build \
--verbose \
--target ${{ matrix.target }} \
--all-features \
--release \
-p rinex-cli \
-p rnx2cggtts \
-p rnx2crx \
-p crx2rnx \
-p ublox-rnx
ls -lah target/${{ matrix.target }}/release
if [ "${{ matrix.os }}" = "windows-latest" ]; then
crx2rnx="target/${{ matrix.target }}/release/crx2rnx.exe"
rnx2crx="target/${{ matrix.target }}/release/rnx2crx.exe"
rinexcli="target/${{ matrix.target }}/release/rinex-cli.exe"
rnx2cggtts="target/${{ matrix.target }}/release/rnx2cggtts.exe"
ubloxrnx="target/${{ matrix.target }}/release/ublox-rnx.exe"
else
crx2rnx="target/${{ matrix.target }}/release/crx2rnx"
rnx2crx="target/${{ matrix.target }}/release/rnx2crx"
rinexcli="target/${{ matrix.target }}/release/rinex-cli"
rnx2cggtts="target/${{ matrix.target }}/release/rnx2cggtts"
ubloxrnx="target/${{ matrix.target }}/release/ublox-rnx"
fi
echo "CRX2RNX=$crx2rnx" >> $GITHUB_ENV
echo "RNX2CRX=$crx2rnx" >> $GITHUB_ENV
echo "RNXCLI=$rinexcli" >> $GITHUB_ENV
echo "RNX2CGGTTS=$rnx2cggtts" >> $GITHUB_ENV
echo "UBX2RNX=$ubloxrnx" >> $GITHUB_ENV
- name: Determine archive name
shell: bash
run: |
echo "ARCHIVE=rinex-${{ github.ref_name }}-${{ matrix.target }}" >> $GITHUB_ENV
- name: Creating directory for archive
shell: bash
run: |
mkdir -p "$ARCHIVE"
cp {README.md,LICENSE-MIT,LICENSE-APACHE} "$ARCHIVE"/
cp "$CRX2RNX" "$ARCHIVE"/
cp "$RNX2CRX" "$ARCHIVE"/
cp "$RNXCLI" "$ARCHIVE"/
cp "$RNX2CGGTTS" "$ARCHIVE"/
cp "$UBX2RNX" "$ARCHIVE"/
- name: Gzip archive (Unix)
shell: bash
if: matrix.os != 'windows-latest'
run: |
tar czf "$ARCHIVE.tar.gz" "$ARCHIVE"
shasum -a 256 "$ARCHIVE.tar.gz" > "$ARCHIVE.tar.gz.sha256"
echo "ASSET=$ARCHIVE.tar.gz" >> $GITHUB_ENV
echo "ASSET_SUM=$ARCHIVE.tar.gz.sha256" >> $GITHUB_ENV
- name: Zip archive (Windows)
shell: bash
if: matrix.os == 'windows-latest'
run: |
7z a "$ARCHIVE.zip" "$ARCHIVE"
certutil -hashfile "$ARCHIVE.zip" SHA256 > "$ARCHIVE.zip.sha256"
echo "ASSET=$ARCHIVE.zip" >> $GITHUB_ENV
echo "ASSET_SUM=$ARCHIVE.zip.sha256" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ASSET }}
path: |
${{ env.ASSET }}
- name: Upload artifacts (cksum)
uses: actions/upload-artifact@v3
with:
name: ${{ env.ASSET_SUM }}
path: |
${{ env.ASSET_SUM }}
release:
runs-on: ubuntu-latest
needs: ['build']
# continue even though we failed to download or upload one
# or more artefacts
continue-on-error: true
steps:
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/create-release@v1
with:
draft: true
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
- name: Download x86_64-unknown-linux-gnu
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
- name: Download x86_64-unknown-linux-gnu (cksum)
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz.sha256
- name: Upload x86_64-unknown-linux-gnu
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
asset_name: rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
asset_content_type: application/gzip
- name: Upload x86_64-unknown-linux-gnu (cksum)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz.sha256
asset_name: rinex-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz.sha256
asset_content_type: application/gzip
- name: Download x86_64-apple-darwin
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
- name: Download x86_64-apple-darwin (cksum)
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz.sha256
- name: Upload x86_64-apple-darwin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
asset_name: rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
asset_content_type: application/gzip
- name: Upload x86_64-apple-darwin (cksum)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz.sha256
asset_name: rinex-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz.sha256
asset_content_type: application/gzip
- name: Download aarch64-apple-darwin
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
- name: Download aarch64-apple-darwin (cksum)
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz.sha256
- name: Upload aarch64-apple-darwin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
asset_name: rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
asset_content_type: application/gzip
- name: Upload aarch64-apple-darwin (cksum)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz.sha256
asset_name: rinex-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz.sha256
asset_content_type: application/gzip
- name: Download x86_64-pc-windows-msvc
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
- name: Download x86_64-pc-windows-msvc (cksum)
uses: actions/download-artifact@v3
with:
name: rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip.sha256
- name: Upload x86_64-pc-windows-msvc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
asset_name: rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
asset_content_type: application/zip
- name: Upload x86_64-pc-windows-msvc (cksum)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip.sha256
asset_name: rinex-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip.sha256
asset_content_type: application/zip