Skip to content

Commit 4232078

Browse files
authored
Ci release (#9)
* update ci release * add doc cfg * bump new revision --------- Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent d3e1032 commit 4232078

File tree

3 files changed

+49
-114
lines changed

3 files changed

+49
-114
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,7 @@ jobs:
1313
name: build
1414
runs-on: ${{ matrix.os }}
1515
env:
16-
# For some builds, we use cross to test on 32-bit and big-endian
17-
# systems.
1816
CARGO: cargo
19-
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
20-
TARGET_FLAGS: ''
21-
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
22-
TARGET_DIR: ./target
23-
# Bump this as appropriate. We pin to a version to make sure CI
24-
# continues to work as cross releases in the past have broken things
25-
# in subtle ways.
26-
CROSS_VERSION: v0.2.5
2717
# Emit backtraces on panics.
2818
RUST_BACKTRACE: 1
2919
strategy:
@@ -33,29 +23,23 @@ jobs:
3323
- build: linux
3424
os: ubuntu-latest
3525
rust: stable
36-
target: x86_64-unknown-linux-musl
37-
strip: x86_64-linux-musl-strip
38-
- build: stable-x86
39-
os: ubuntu-latest
40-
rust: stable
41-
target: i686-unknown-linux-gnu
42-
strip: x86_64-linux-gnu-strip
26+
target: x86_64-unknown-linux-gnu
4327
- build: macos
4428
os: macos-latest
45-
rust: nightly
29+
rust: stable
4630
target: x86_64-apple-darwin
47-
- build: win-msvc
31+
- build: macos
32+
os: macos-latest
33+
rust: stable
34+
target: aarch64-apple-darwin
35+
- build: win64-msvc
4836
os: windows-latest
49-
rust: nightly
37+
rust: stsable-x86_64-gnu
5038
target: x86_64-pc-windows-msvc
51-
- build: win-gnu
39+
- build: win64-gnu
5240
os: windows-latest
53-
rust: nightly-x86_64-gnu
41+
rust: stable
5442
target: x86_64-pc-windows-gnu
55-
- build: win32-msvc
56-
os: windows-latest
57-
rust: nightly
58-
target: i686-pc-windows-msvc
5943

6044
steps:
6145
- name: Checkout repository
@@ -66,65 +50,28 @@ jobs:
6650
with:
6751
toolchain: ${{ matrix.rust }}
6852
target: ${{ matrix.target }}
69-
- name: Use Cross
70-
if: matrix.os == 'ubuntu-latest' && matrix.target != ''
71-
shell: bash
72-
run: |
73-
# In the past, new releases of 'cross' have broken CI. So for now, we
74-
# pin it. We also use their pre-compiled binary releases because cross
75-
# has over 100 dependencies and takes a bit to compile.
76-
dir="$RUNNER_TEMP/cross-download"
77-
mkdir "$dir"
78-
echo "$dir" >> $GITHUB_PATH
79-
cd "$dir"
80-
curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
81-
tar xf cross-x86_64-unknown-linux-musl.tar.gz
82-
echo "CARGO=cross" >> $GITHUB_ENV
8353

84-
- name: Set target variables
54+
- name: Build applications
8555
shell: bash
8656
run: |
87-
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
88-
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
89-
90-
- name: Show command used for Cargo
91-
shell: bash
92-
run: |
93-
echo "cargo command is: ${{ env.CARGO }}"
94-
echo "target flag is: ${{ env.TARGET_FLAGS }}"
95-
echo "target dir is: ${{ env.TARGET_DIR }}"
96-
97-
- name: Build release binary
98-
shell: bash
99-
run: |
100-
${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }}
57+
CARGO_PROFILE_RELEASE_STRIP=symbols ${{ env.CARGO }} build \
58+
--verbose \
59+
--target ${{ matrix.target }} \
60+
--all-features \
61+
--release \
62+
-p cggtts-cli
63+
ls -lah target/${{ matrix.target }}/release
10164
if [ "${{ matrix.os }}" = "windows-latest" ]; then
10265
bin="target/${{ matrix.target }}/release/cggtts-cli.exe"
10366
else
10467
bin="target/${{ matrix.target }}/release/cggtts-cli"
10568
fi
10669
echo "BIN=$bin" >> $GITHUB_ENV
10770
108-
- name: Strip release binary (macos)
109-
if: matrix.os == 'macos-latest'
110-
shell: bash
111-
run: strip "$BIN"
112-
113-
- name: Strip release binary (cross)
114-
if: env.CARGO == 'cross'
115-
shell: bash
116-
run: |
117-
docker run --rm -v \
118-
"$PWD/target:/target:Z" \
119-
"rustembedded/cross:${{ matrix.target }}" \
120-
"${{ matrix.strip }}" \
121-
"/target/${{ matrix.target }}/release/cggtts-cli"
122-
12371
- name: Determine archive name
12472
shell: bash
12573
run: |
126-
version="${{ needs.create-release.outputs.version }}"
127-
echo "ARCHIVE=cggtts-cli-$version-${{ matrix.target }}" >> $GITHUB_ENV
74+
echo "ARCHIVE=cggtts-cli-${{ github.ref_name }}-${{ matrix.target }}" >> $GITHUB_ENV
12875
12976
- name: Creating directory for archive
13077
shell: bash
@@ -133,7 +80,7 @@ jobs:
13380
cp "$BIN" "$ARCHIVE"/
13481
cp {README.md,LICENSE-MIT,LICENSE-APACHE} "$ARCHIVE"/
13582
136-
- name: Build archive (Unix)
83+
- name: Gzip archive (Unix)
13784
shell: bash
13885
if: matrix.os != 'windows-latest'
13986
run: |
@@ -142,7 +89,7 @@ jobs:
14289
echo "ASSET=$ARCHIVE.tar.gz" >> $GITHUB_ENV
14390
echo "ASSET_SUM=$ARCHIVE.tar.gz.sha256" >> $GITHUB_ENV
14491
145-
- name: Build archive (Windows)
92+
- name: Zip archive (Windows)
14693
shell: bash
14794
if: matrix.os == 'windows-latest'
14895
run: |
@@ -173,93 +120,77 @@ jobs:
173120
tag_name: ${{ github.ref_name }}
174121
release_name: ${{ github.ref_name }}
175122

176-
- name: Download linux-stable (musl)
123+
- name: Download linux-stable
177124
uses: actions/download-artifact@v3
178125
with:
179-
name: cggtts-cli--x86_64-unknown-linux-musl.tar.gz
126+
name: cggtts-cli-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
180127

181-
- name: Upload linux-stable (musl)
128+
- name: Upload linux-stable
182129
uses: actions/upload-release-asset@v1
183130
env:
184131
GITHUB_TOKEN: ${{ github.token }}
185132
with:
186133
upload_url: ${{ steps.create_release.outputs.upload_url }}
187-
asset_path: cggtts-cli--x86_64-unknown-linux-musl.tar.gz
188-
asset_name: cggtts-cli-x86_x64-linux-musl.tar.gz
134+
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
135+
asset_name: cggtts-cli-x86_x64-linux-gnu.tar.gz
189136
asset_content_type: application/gzip
190137

191-
- name: Download linux-stable (i686)
138+
- name: Download macos-latest
192139
uses: actions/download-artifact@v3
193140
with:
194-
name: cggtts-cli--i686-unknown-linux-gnu.tar.gz
141+
name: cggtts-cli-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
195142

196-
- name: Upload linux-stable (i686)
143+
- name: Upload macos-latest
197144
uses: actions/upload-release-asset@v1
198145
env:
199146
GITHUB_TOKEN: ${{ github.token }}
200147
with:
201148
upload_url: ${{ steps.create_release.outputs.upload_url }}
202-
asset_path: cggtts-cli--i686-unknown-linux-gnu.tar.gz
203-
asset_name: cggtts-cli-i686-linux-gnu.tar.gz
149+
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
150+
asset_name: cggtts-cli-x86_64-apple-darwin.tar.gz
204151
asset_content_type: application/gzip
205-
206-
- name: Download macos-latest
152+
153+
- name: Download macos-latest (aarch64)
207154
uses: actions/download-artifact@v3
208155
with:
209-
name: cggtts-cli--x86_64-apple-darwin.tar.gz
156+
name: cggtts-cli-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
210157

211158
- name: Upload macos-latest
212159
uses: actions/upload-release-asset@v1
213160
env:
214161
GITHUB_TOKEN: ${{ github.token }}
215162
with:
216163
upload_url: ${{ steps.create_release.outputs.upload_url }}
217-
asset_path: cggtts-cli--x86_64-apple-darwin.tar.gz
218-
asset_name: cggtts-cli--x86_64-apple-darwin.tar.gz
164+
asset_path: cggtts-cli-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
165+
asset_name: cggtts-cli-aarch64-apple-darwin.tar.gz
219166
asset_content_type: application/gzip
220167

221-
- name: Download windows i686
222-
uses: actions/download-artifact@v3
223-
with:
224-
name: cggtts-cli--i686-pc-windows-msvc.zip
225-
226-
- name: Upload windows i686
227-
uses: actions/upload-release-asset@v1
228-
env:
229-
GITHUB_TOKEN: ${{ github.token }}
230-
with:
231-
upload_url: ${{ steps.create_release.outputs.upload_url }}
232-
asset_path: cggtts-cli--i686-pc-windows-msvc.zip
233-
asset_name: cggtts-cli--i686-pc-windows-msvc.zip
234-
asset_content_type: application/zip
235-
236168
- name: Download windows x86_64 (msvc)
237169
uses: actions/download-artifact@v3
238170
with:
239-
name: cggtts-cli--x86_64-pc-windows-msvc.zip
171+
name: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
240172

241173
- name: Download windows x86_64 (msvc)
242174
uses: actions/upload-release-asset@v1
243175
env:
244176
GITHUB_TOKEN: ${{ github.token }}
245177
with:
246178
upload_url: ${{ steps.create_release.outputs.upload_url }}
247-
asset_path: cggtts-cli--x86_64-pc-windows-msvc.zip
248-
asset_name: cggtts-cli--x86_64-pc-windows-msvc.zip
179+
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
180+
asset_name: cggtts-cli-x86_64-pc-windows-msvc.zip
249181
asset_content_type: application/zip
250182

251183
- name: Download windows x86_64 (gnu)
252184
uses: actions/download-artifact@v3
253185
with:
254-
name: cggtts-cli--x86_64-pc-windows-gnu.zip
186+
name: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-gnu.zip
255187

256188
- name: Download windows x86_64 (msvc)
257189
uses: actions/upload-release-asset@v1
258190
env:
259191
GITHUB_TOKEN: ${{ github.token }}
260192
with:
261193
upload_url: ${{ steps.create_release.outputs.upload_url }}
262-
asset_path: cggtts-cli--x86_64-pc-windows-gnu.zip
263-
asset_name: cggtts-cli--x86_64-pc-windows-gnu.zip
194+
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-gnu.zip
195+
asset_name: cggtts-cli-x86_64-pc-windows-gnu.zip
264196
asset_content_type: application/zip
265-

cggtts-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cggtts-cli"
3-
version = "1.0.2"
3+
version = "1.0.3"
44
license = "MIT OR Apache-2.0"
55
authors = ["Guillaume W. Bres <[email protected]>"]
66
description = "Command line tool parse and analyze CGGTTS data"
@@ -17,6 +17,6 @@ itertools = "0.11.0"
1717
env_logger = "0.10"
1818
clap = { version = "4.4.6", features = ["derive", "color"] }
1919
serde = { version = "1.0", default-features = false, features = ["derive"] }
20-
cggtts = { path = "../cggtts", version = "=4.1.1" }
20+
cggtts = { path = "../cggtts", version = "=4.1.2" }
2121
plotly = "0.8.4"
2222
# plotly = { git = "https://github.com/gwbres/plotly", branch = "density-mapbox" }

cggtts/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cggtts"
3-
version = "4.1.1"
3+
version = "4.1.2"
44
license = "MIT OR Apache-2.0"
55
authors = ["Guillaume W. Bres <[email protected]>"]
66
description = "Package to analyze and create CGGTTS data"
@@ -31,3 +31,7 @@ polyfit-rs = { version = "0.2.1", optional = true }
3131

3232
[dev-dependencies]
3333
rand = "0.8.4"
34+
35+
[package.metadata.docs.rs]
36+
all-features = true
37+
rustdoc-args = ["--cfg", "docrs", "--generate-link-to-definition"]

0 commit comments

Comments
 (0)