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
|
name: Release
on:
push:
branches: [main]
workflow_dispatch:
jobs:
prepare:
name: Prepare release tag
runs-on: ubuntu-latest
outputs:
version: "${{ steps.extract.outputs.version }}"
tag: "${{ steps.extract.outputs.tag }}"
steps:
- uses: gitwall/checkout@v1
- id: extract
name: Extract version
run: |
VERSION=$(sed -n 's/^version *= *"\([^"]*\)".*/\1/p' Cargo.toml | head -1)
if [ -z "$VERSION" ]; then
echo "Could not read version from Cargo.toml"
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
build-linux-amd64:
name: Build linux-amd64
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: gitwall/checkout@v1
- uses: gitwall/setup-rust@v1
with:
toolchain: stable
cache: true
- name: Install cross
run: cargo install cross --locked --root .cargo-cross
- name: Build
run: ./.cargo-cross/bin/cross build --release --target x86_64-unknown-linux-musl
- name: Stage binary
run: |
mkdir -p dist
cp target/x86_64-unknown-linux-musl/release/leakguard dist/leakguard-linux-amd64
- uses: gitwall/upload-artifact@v1
with:
name: leakguard-linux-amd64
path: dist/leakguard-linux-amd64
if-no-files-found: error
build-linux-arm64:
name: Build linux-arm64
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: gitwall/checkout@v1
- uses: gitwall/setup-rust@v1
with:
toolchain: stable
cache: true
- name: Install cross
run: cargo install cross --locked --root .cargo-cross
- name: Build
run: ./.cargo-cross/bin/cross build --release --target aarch64-unknown-linux-musl
- name: Stage binary
run: |
mkdir -p dist
cp target/aarch64-unknown-linux-musl/release/leakguard dist/leakguard-linux-arm64
- uses: gitwall/upload-artifact@v1
with:
name: leakguard-linux-arm64
path: dist/leakguard-linux-arm64
if-no-files-found: error
wheel-linux-amd64:
name: Wheel linux-amd64
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: gitwall/checkout@v1
- uses: gitwall/install-packages@v1
with:
packages: |
build-essential
pkg-config
python3
python3-pip
python3-venv
- uses: gitwall/setup-rust@v1
with:
toolchain: stable
cache: true
- name: Build wheel
run: |
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip maturin
mkdir -p dist
maturin build --release --out dist --target x86_64-unknown-linux-gnu
- uses: gitwall/upload-artifact@v1
with:
name: wheels-linux-amd64
path: dist/*.whl
if-no-files-found: error
release:
name: Create GitWall release
runs-on: ubuntu-latest
needs:
- prepare
- build-linux-amd64
- build-linux-arm64
- wheel-linux-amd64
steps:
- uses: gitwall/download-artifact@v1
with:
path: dist
merge-multiple: true
- name: Show artifacts
run: ls -lh dist/
- uses: gitwall/create-release@v1
with:
tag_name: "${{ needs.prepare.outputs.tag }}"
name: "leakguard ${{ needs.prepare.outputs.tag }}"
files: dist/*
body: |
```bash
pip install leakguard
leakguard check .
```
| Platform | File |
|----------|------|
| Linux x86_64 | `leakguard-linux-amd64` |
| Linux ARM64 | `leakguard-linux-arm64` |
| Linux wheel | `leakguard-*.whl` |
```bash
chmod +x leakguard-linux-amd64
sudo mv leakguard-linux-amd64 /usr/local/bin/leakguard
```
|