Repository navigation
82 lines (79 loc) · 2.58 KB
/
Copy pathrelease-cli.yml
File metadata and controls
82 lines (79 loc) · 2.58 KB
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
name: Release CLI
# Linux rpt binaries. Pushes to main upload artifacts only.
# A tag v<Cargo.toml version> also attaches the tarballs to that GitHub Release.
on:
workflow_dispatch:
push:
tags: ["v*"]
branches: [main]
jobs:
rpt:
name: ${{ matrix.artifact }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
artifact: rpt-linux-x86_64
- os: ubuntu-24.04
target: x86_64-unknown-linux-musl
artifact: rpt-linux-x86_64-musl
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
artifact: rpt-linux-aarch64
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
artifact: rpt-linux-aarch64-musl
steps:
- uses: actions/checkout@v4
- name: Install musl tools
if: contains(matrix.target, 'musl')
run: sudo apt-get update && sudo apt-get install -y musl-tools
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build rpt
run: cargo build -p rpt-cli --release --target ${{ matrix.target }}
- name: Pack the binary
run: |
bin="target/${{ matrix.target }}/release/rpt"
file "$bin"
# musl targets should not need libgcc_s or libc.so.6
if [[ "${{ matrix.target }}" == *musl* ]]; then
if ldd "$bin" 2>&1 | grep -E 'libc\.so|libgcc_s' ; then
echo "musl binary is dynamically linked to glibc" >&2
exit 1
fi
fi
mkdir -p dist
cp "$bin" dist/rpt
tar -C dist -czf "${{ matrix.artifact }}.tar.gz" rpt
sha256sum "${{ matrix.artifact }}.tar.gz" > "${{ matrix.artifact }}.tar.gz.sha256"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: |
${{ matrix.artifact }}.tar.gz
${{ matrix.artifact }}.tar.gz.sha256
if-no-files-found: error
release:
name: GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
needs: rpt
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: rpt-linux-*
merge-multiple: true
path: dist
- name: Upload rpt binaries
env:
GH_TOKEN: ${{ github.token }}
run: sh packaging/publish-release.sh dist SHA256SUMS-cli.txt