Skip to content

Commit fe4df7d

Browse files
committed
Test and publish an RPM
Signed-off-by: George Holderness <[email protected]>
1 parent b6fd159 commit fe4df7d

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,48 @@ jobs:
6767
floki*.zip
6868
floki*.tar.gz
6969
70+
71+
rpm:
72+
name: Build and test RPM using cargo generate-rpm
73+
runs-on: ubuntu-24.04
74+
needs: build
75+
steps:
76+
- uses: actions/checkout@v5
77+
- name: Install rust
78+
uses: dtolnay/rust-toolchain@master
79+
with:
80+
toolchain: stable
81+
- name: Install cargo-generate-rpm
82+
run: cargo install cargo-generate-rpm
83+
# Download the ubuntu artifact instead of rebuilding.
84+
- name: Download artifacts
85+
uses: actions/download-artifact@v4
86+
with:
87+
name: stableartifacts-ubuntu-24.04
88+
- name: Build RPM
89+
run: |
90+
tar -xzvf floki*.tar.gz
91+
mkdir -p target/release
92+
cp floki target/release/floki
93+
cargo generate-rpm
94+
- name: Install RPM
95+
run: find . -name "floki*.rpm" | xargs rpm -ivh
96+
- name: Test installation
97+
run: floki -V
98+
- name: Archive artifacts
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: rpm
102+
path: |
103+
target/generate-rpm/floki*.rpm
104+
70105
publish:
71106
name: Publish release artifact
72107
runs-on: ubuntu-latest
73108
if: github.ref_type == 'tag'
74109
needs:
75110
- build
111+
- rpm
76112
# Required to publish a release
77113
permissions:
78114
contents: write
@@ -97,6 +133,10 @@ jobs:
97133
uses: actions/download-artifact@v5
98134
with:
99135
name: stableartifacts-macos-latest
136+
- name: Download RPM
137+
uses: actions/download-artifact@v5
138+
with:
139+
name: rpm
100140
- name: Generate release.txt
101141
run: "./changelog.sh"
102142
- name: Release
@@ -106,6 +146,7 @@ jobs:
106146
files: |
107147
floki*.zip
108148
floki*.tar.gz
149+
floki*.rpm
109150
# # Announce the release
110151
# - run: "./announce.sh"
111152
# env:
@@ -117,6 +158,7 @@ jobs:
117158
if: github.ref_type != 'tag'
118159
needs:
119160
- build
161+
- rpm
120162
steps:
121163
- uses: actions/checkout@v5
122164
- name: Install rust
@@ -136,6 +178,10 @@ jobs:
136178
uses: actions/download-artifact@v5
137179
with:
138180
name: stableartifacts-macos-latest
181+
- name: Download rpm
182+
uses: actions/download-artifact@v5
183+
with:
184+
name: rpm
139185
# Test generating release.txt
140186
- name: Generate release.txt
141187
run: "./changelog.sh"

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ then
2828
# Check that it's statically compiled!
2929
ldd floki
3030

31+
# Strip .gnu.hash since floki is statically compiled.
32+
# Required so that cargo-generate-rpm does not introduce a dependency on the RTLD.
33+
strip --remove-section=.gnu.hash floki
34+
3135
tar -cvzf floki-${LABEL}.tar.gz floki
3236
else
3337
echo "Building release binary"

0 commit comments

Comments
 (0)