Skip to content

Commit a42576d

Browse files
committed
Add RPM rebuild to CI
Signed-off-by: Jakub Jelen <[email protected]>
1 parent d00d3c3 commit a42576d

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

.github/workflows/rpm.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: RPM build
3+
4+
on:
5+
pull_request:
6+
branches: ["main"]
7+
8+
jobs:
9+
rpmbuild:
10+
name: Generate crate and run RPM Build
11+
runs-on: ubuntu-22.04
12+
container: fedora:rawhide
13+
steps:
14+
- name: Install Dependencies
15+
run: |
16+
dnf -y install rustc cargo-rpm-macros openssl-devel \
17+
'crate(asn1/default)' 'crate(bimap/default)' \
18+
'crate(bindgen/default)' 'crate(bitflags/default)' 'crate(cfg-if/default)' \
19+
'crate(clap)' 'crate(clap/cargo)' 'crate(clap/derive)' 'crate(clap/help)' \
20+
'crate(clap/std)' 'crate(clap/usage)' 'crate(constant_time_eq/default)' \
21+
'crate(data-encoding/default)' 'crate(getrandom/default)' 'crate(hex/default)' \
22+
'crate(itertools/default)' 'crate(libc/default)' 'crate(num-bigint/default)' \
23+
'crate(num-integer/default)' 'crate(num-traits/default)' 'crate(once_cell/default)' \
24+
'crate(paste/default)' 'crate(pkg-config/default)' 'crate(rusqlite/default)' \
25+
'crate(serde/default)' 'crate(serde/derive)' 'crate(serde_json/default)' \
26+
'crate(serial_test/default)' 'crate(toml)' 'crate(toml/display)' 'crate(toml/parse)' \
27+
'crate(uuid/default)' 'crate(uuid/v4)'
28+
29+
- name: Checkout Repository
30+
uses: actions/checkout@v4
31+
32+
- name: RPM Build
33+
run: |
34+
cargo package --features=standard,dynamic,nssdb
35+
mkdir -p rpmbuild/SOURCES
36+
cp target/package/kryoptic-*.crate rpmbuild/SOURCES/
37+
rpmbuild --define "_topdir $PWD/rpmbuild" -ba \
38+
packaging/kryoptic.spec
39+

packaging/kryoptic.spec

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
# prevent library files from being installed
55
%global cargo_install_lib 0
66

7-
%global commit b37f7ee15473f0b7c9546855136d8b5ec3db1750
8-
%global shortcommit %(c=%{commit}; echo ${c:0:7})
9-
%global revision_date 20250225
10-
117
Name: kryoptic
12-
Version: 0.1.0^%{revision_date}.git%{shortcommit}
8+
Version: 0.1.0
139
Release: %autorelease
1410
Summary: PKCS #11 software token written in Rust
1511

@@ -28,7 +24,7 @@ License: Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (BSD
2824
# LICENSE.dependencies contains a full license breakdown
2925

3026
URL: https://github.com/latchset/kryoptic
31-
Source: https://github.com/latchset/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
27+
Source: https://github.com/latchset/%{name}/archive/%{commit}/%{name}-%{version}.crate
3228

3329
BuildRequires: cargo-rpm-macros >= 26
3430
BuildRequires: openssl-devel
@@ -47,7 +43,7 @@ Supporting tools for kryoptic software token.
4743
Most notably a migration tool for the SoftHSM database.
4844

4945
%prep
50-
%autosetup -n kryoptic-%{commit} -p1
46+
%autosetup -n kryoptic-%{version} -p1
5147
%cargo_prep
5248

5349
%generate_buildrequires

0 commit comments

Comments
 (0)