File tree 3 files changed +76
-63
lines changed 3 files changed +76
-63
lines changed Original file line number Diff line number Diff line change 14
14
tags-ignore :
15
15
- ' **'
16
16
17
- env :
18
- DOCKER_DRIVER : overlay
19
- CARGO_NET_GIT_FETCH_WITH_CLI : true
20
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER : aarch64-linux-gnu-gcc
21
-
22
17
jobs :
23
18
test :
24
19
runs-on : ubuntu-latest
34
29
cargo test
35
30
36
31
build :
37
- runs-on : ubuntu-latest
38
- container : rust:1.72
39
32
needs : test
40
- steps :
41
- - uses : actions/checkout@v3
42
- - name : Setup
43
- run : |
44
- rustup target add x86_64-unknown-linux-musl
45
- rustup target add aarch64-unknown-linux-musl
46
-
47
- apt-get update
48
- apt-get install -y musl-tools musl-dev
49
-
50
- if [ '${{ contains(inputs.arch, 'arm64') }}' = 'true' ]; then
51
- apt-get install -y gcc-aarch64-linux-gnu
52
- fi
53
-
54
- - name : Build & package amd64
55
- if : ${{ contains(inputs.arch, 'amd64') }}
56
- run : |
57
- cargo build --release --target x86_64-unknown-linux-musl
58
- ./scripts/package ./dist ./target/x86_64-unknown-linux-musl/release
59
-
60
- - name : Build & package arm64
61
- if : ${{ contains(inputs.arch, 'arm64') }}
62
- run : |
63
- cargo build --release --target aarch64-unknown-linux-musl
64
- ./scripts/package ./dist ./target/aarch64-unknown-linux-musl/release
65
-
66
- - name : Archive
67
- uses : actions/upload-artifact@v3
68
- with :
69
- name : package
70
- retention-days : 1
71
- path : dist/*.tar.gz
33
+ uses : ./.github/workflows/wc_build_binaries.yml
34
+ with :
35
+ arch : ${{ inputs.arch }}
36
+ artifact_retention : 1
Original file line number Diff line number Diff line change 1
1
name : Release
2
2
on :
3
- push :
4
- tags :
5
- - " v*"
6
- # Workflow dispatch should be used only as fallback method
3
+ # Remember to select a Git tag otherwise the workflow will fail
7
4
workflow_dispatch :
8
5
inputs :
9
6
arch :
20
17
CARGO_NET_GIT_FETCH_WITH_CLI : true
21
18
22
19
jobs :
23
- build :
20
+ check :
24
21
runs-on : ubuntu-latest
25
22
steps :
26
23
- uses : actions/checkout@v3
@@ -29,28 +26,24 @@ jobs:
29
26
VERSION_IN_CARGO=$(find . -type f -name 'Cargo.toml' -exec grep -oP '^\W*version\W*\K[0-9\.]+' {} \; | sort -nru | head -1)
30
27
GIT_TAG='${{ github.ref_name }}'
31
28
32
- if [ "${GIT_TAG/#v/}" != "${VERSION_IN_CARGO}" ]; then
33
- echo 'git tag and Cargo.toml version mismatch'
34
- echo "${GIT_TAG/#v/} != ${VERSION_IN_CARGO}"
29
+ if [[ "${GIT_TAG/#v/}" != "${VERSION_IN_CARGO}" ]]; then
30
+ echo 'Version mismatch between git tag and Cargo.toml'
31
+ echo "git: ${GIT_TAG/#v/}"
32
+ echo "cargo: ${VERSION_IN_CARGO}"
35
33
echo ''
36
- echo 'REMINDER: Git tags must start with "v"'
34
+ echo 'REMINDERS:'
35
+ echo ' - This workflow must be triggered from a Git tag'
36
+ echo ' - Git tags must start with "v"'
37
37
exit 1
38
38
fi
39
- - name : Setup
40
- run : |
41
- ./scripts/build-setup
42
- - name : Build
43
- run : |
44
- ./scripts/build ${{ inputs.arch }}
45
- - name : Package
46
- run : |
47
- ./scripts/package
48
- - name : Archive
49
- uses : actions/upload-artifact@v3
50
- with :
51
- name : package
52
- retention-days : 7
53
- path : dist/*.tar.gz
39
+ shell : bash
40
+
41
+ build :
42
+ needs : check
43
+ uses : ./.github/workflows/wc_build_binaries.yml
44
+ with :
45
+ arch : ${{ inputs.arch }}
46
+ artifact_retention : 7
54
47
55
48
release :
56
49
runs-on : ubuntu-latest
64
57
- name : Publish release
65
58
uses : softprops/action-gh-release@v1
66
59
with :
60
+ prerelease : true
67
61
files : |
68
62
dist/*.tar.gz
Original file line number Diff line number Diff line change
1
+ name : build binaries
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ arch :
6
+ required : false
7
+ type : string
8
+ default : amd64
9
+ artifact_retention :
10
+ required : false
11
+ type : number
12
+ default : 1
13
+
14
+ env :
15
+ DOCKER_DRIVER : overlay
16
+ CARGO_NET_GIT_FETCH_WITH_CLI : true
17
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER : aarch64-linux-gnu-gcc
18
+
19
+ jobs :
20
+ binaries :
21
+ runs-on : ubuntu-latest
22
+ container : rust:1.72
23
+ steps :
24
+ - uses : actions/checkout@v3
25
+ - name : Setup
26
+ run : |
27
+ rustup target add x86_64-unknown-linux-musl
28
+ rustup target add aarch64-unknown-linux-musl
29
+
30
+ apt-get update
31
+ apt-get install -y musl-tools musl-dev
32
+
33
+ if [ '${{ contains(inputs.arch, 'arm64') }}' = 'true' ]; then
34
+ apt-get install -y gcc-aarch64-linux-gnu
35
+ fi
36
+
37
+ - name : Build & package amd64
38
+ if : ${{ contains(inputs.arch, 'amd64') }}
39
+ run : |
40
+ cargo build --release --target x86_64-unknown-linux-musl
41
+ ./scripts/package ./target/x86_64-unknown-linux-musl/release
42
+
43
+ - name : Build & package arm64
44
+ if : ${{ contains(inputs.arch, 'arm64') }}
45
+ run : |
46
+ cargo build --release --target aarch64-unknown-linux-musl
47
+ ./scripts/package ./target/aarch64-unknown-linux-musl/release
48
+
49
+ - name : Archive
50
+ uses : actions/upload-artifact@v3
51
+ with :
52
+ name : package
53
+ retention-days : ${{ inputs.artifact_retention }}
54
+ path : dist/*.tar.gz
You can’t perform that action at this time.
0 commit comments