Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.0 #57

Merged
merged 200 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
95a2309
secvarctl: reorganised host secure boot variable backend
SudhakarKuppusamy1 Mar 7, 2023
edee078
secvarctl: guest secure boot variable backend
SudhakarKuppusamy1 Mar 23, 2023
0859c73
guest-backend: unit test cases
SudhakarKuppusamy1 Apr 6, 2023
3fe755f
secvarctl: updating README
SudhakarKuppusamy1 Mar 29, 2023
22f13ff
CMakefile : CMakefile for Secvarctl, HOST_BACKEND, GUEST_BACKEND
May 9, 2023
2598869
README : Updated Readme with Cmake Building Options
May 9, 2023
7433cad
add libstb-secvar git submodule
erichte-ibm May 9, 2023
df2bd06
cmake: add libstb-secvar root to include list
erichte-ibm May 9, 2023
93bf604
WIP: temporarily disable CI, since things are going to be broken for …
erichte-ibm Jun 21, 2023
d30a0e2
cmake: remove existing cmake build files, will be restored after the …
erichte-ibm Jun 21, 2023
01bf2aa
treewide: rearrange source directories
erichte-ibm Jun 29, 2023
d83c621
Makefile: rewrite build system
erichte-ibm Jun 29, 2023
64e15db
.gitignore: ignore the obj/ directory instead of artifact file types
erichte-ibm Jun 29, 2023
57a1487
test: rework make check targets
erichte-ibm Jun 29, 2023
655c966
guest/verify: fix warning by removing a useless NULL check
erichte-ibm Jun 29, 2023
901102b
guest/verify: fix uninitialized variable warning by initializing it
erichte-ibm Jun 29, 2023
6008096
guest/verify: rewrite get_current_esl()
erichte-ibm Jun 29, 2023
683de4e
Makefile: re-enable -Werror, as warnings have been cleared (hopefully)
erichte-ibm Jun 29, 2023
f8dd10c
test/Makefile: fix memcheck target not patsubst'ing the right pat
erichte-ibm Jul 5, 2023
21d9257
test/Makefile: remove redundant SECVAR_TOOLS variable, fix default to…
erichte-ibm Jul 5, 2023
702937c
guest/verify: use calloc instead of malloc+memset
erichte-ibm Jul 5, 2023
13a1388
test/guest: remove unnecessary prints
erichte-ibm Jul 5, 2023
e234459
Makefile: fix partial rebuilds when header files change
erichte-ibm Jul 5, 2023
eda7785
Makefile: update .PHONY list
erichte-ibm Jul 6, 2023
e332151
Makefile: reintroduce format target, shuffle SRCS variables
erichte-ibm Jul 6, 2023
a035fb7
treewide: apply formatting rules
erichte-ibm Jul 6, 2023
47770f6
Makefile: add cppcheck static analysis target similar to libstb-secvar's
erichte-ibm Jul 12, 2023
446c5bc
guest/generate: remove always true conditions as reported by cppcheck
erichte-ibm Jul 12, 2023
283e068
guest/generate: fix incorrect allocation check
erichte-ibm Jul 12, 2023
1ab3677
guest/generate: unsigned (size_t) variables cannot be less than zero
erichte-ibm Jul 12, 2023
aaab7f2
guest/read: change printf format specifier to %zu to match variable type
erichte-ibm Jul 12, 2023
ab3e742
guest/valdiate: change printf format specific to %zu to match variabl…
erichte-ibm Jul 12, 2023
3372a0d
guest/validate: actually make a forward declartion of rc useful
erichte-ibm Jul 12, 2023
c9e122f
guest/validate: put variables only used in an #ifdef also behind the …
erichte-ibm Jul 12, 2023
5aefc38
guest/read: reduce scope of loop-only variables
erichte-ibm Jul 12, 2023
90c1c8b
guest/verify: refactor get_pk_and_kek_from_update_var()
erichte-ibm Jul 12, 2023
ada4627
guest/verify: functions should not just be one giant conditional
erichte-ibm Jul 12, 2023
ad01f0b
guest/verify: reduce the scope of the loop index
erichte-ibm Jul 12, 2023
c2d8fb3
guest/read: size_t variables literally can't be -1
erichte-ibm Jul 12, 2023
3099fb0
guest/read: size_t = %zu
erichte-ibm Jul 12, 2023
af28ed9
guest/read: reduce scope of variables that are only used by WRITE_FUN…
erichte-ibm Jul 12, 2023
b90683c
guest/verify: remove extraneous code after break in parse_options
erichte-ibm Jul 18, 2023
3f9d626
generic: remove unusued function get_leading_whitespace
erichte-ibm Jul 12, 2023
df2dcde
host/generate: fix invalid malloc return check
erichte-ibm Jul 12, 2023
8e5fe79
backends/host: unsigned integers still can't be less than zero
erichte-ibm Jul 12, 2023
32329c1
host/read: reduce the scope of variables in printReadable
erichte-ibm Jul 12, 2023
13e1bde
host/read: fix weird pointer increment in readTS
erichte-ibm Jul 12, 2023
c20f467
host/validate: reduce scope of variables
erichte-ibm Jul 18, 2023
26a890a
host/validate: add a NULL check to the **x509 parameter of parseX509
erichte-ibm Jul 18, 2023
7d530b9
host/verify: remove assignment with no effect
erichte-ibm Jul 18, 2023
a0d8df2
host/validate: change ts_ptr to const in timestamp_is_empty
erichte-ibm Jul 18, 2023
4134538
host/verify: remove redundant check, as <= 1 implies !
erichte-ibm Jul 18, 2023
8a7d543
guest: use system endian.h, as it's entirely ambiguous which endian.h…
erichte-ibm Jul 18, 2023
185910b
Makefile: fix include pathing for cppcheck
erichte-ibm Jul 18, 2023
0e7ef55
guest/generate: fix format string typing (int -> uint)
erichte-ibm Jul 18, 2023
2fbf087
guest/read: fix format string typing
erichte-ibm Jul 18, 2023
f959f86
guest/validate: remove needless esl_size variable alias from validate…
erichte-ibm Jul 18, 2023
7eac638
guest/validate: fix format string typing
erichte-ibm Jul 18, 2023
a0189fa
guest/validate: unsigned integers still can't be less than zero
erichte-ibm Jul 18, 2023
81c0f1a
guest/verify: remove redundant check, unsigned less than 0, etc etc
erichte-ibm Jul 18, 2023
22c0905
more unsigned printf fixes
erichte-ibm Jul 19, 2023
1339ab4
host/validate: %zu
erichte-ibm Jul 19, 2023
0e8fd15
host/validate: remove useless eslsize alias
erichte-ibm Jul 19, 2023
16fa1e0
host/validate: always free a buffer that always exists
erichte-ibm Jul 19, 2023
553ed06
host/validate: unsigned still can't be less than zero
erichte-ibm Jul 19, 2023
77bd6e6
guest/read: remove conditional that is always true in read_auth
erichte-ibm Jul 19, 2023
4059ed0
host/read: standard for unsigned unchanged, still cannot be less than…
erichte-ibm Jul 19, 2023
4c0f0f6
host/generate: check that ESL is not NULL is getPreHashForSecVar
erichte-ibm Jul 19, 2023
94a8110
guest/read: check auth_data is not NULL in read_auth
erichte-ibm Jul 19, 2023
16b3cd8
host/verify: fix potential memory leak in setupBanks
erichte-ibm Jul 19, 2023
ed8bca3
guest/verify: fix potential double free in get_pk_and_kek from update…
erichte-ibm Jul 19, 2023
26a0ca2
host/generate: fix unsigned printf format strings with CRYPTO_WRITE_F…
erichte-ibm Jul 20, 2023
2ab82e5
Makefile/cppcheck: suppress false positives, reorganize cppcheck flag…
erichte-ibm Jul 20, 2023
d82fe78
guest/verify: display usage if arguments fail to validate
erichte-ibm Aug 1, 2023
e77b8c3
guest/validate: reduce scope of rc in validate_esl
erichte-ibm Aug 1, 2023
d8aff3b
test/host-generate: fix incorrect default binary path for GEN commands
erichte-ibm Jul 26, 2023
366e3e7
Makefile: rework debug build, replace valgrind with ASAN
erichte-ibm Jul 26, 2023
3732f7f
gitignore: update to use bin paths, replace -cov with -dbg, add some …
erichte-ibm Jul 26, 2023
956e8c2
Makefile: split default CFLAGS into release and debug groups, remove …
erichte-ibm Jul 26, 2023
c13be9b
Makefile: add variable-based control for disabling ASAN
erichte-ibm Jul 27, 2023
27c7f69
Makefile: use INCLUDES directly in the compile line rather than injec…
erichte-ibm Jul 27, 2023
f6e6fc1
host/generate: fix memcpy from NULL undefined behavior
erichte-ibm Jul 26, 2023
28bb0ac
guest/util: rewrite get_signature_type() to use a comprehensive looku…
erichte-ibm Jul 27, 2023
a969567
guest/util: replace all usage of signature type as a string with the …
erichte-ibm Jul 27, 2023
8511563
guest/generate: fix undefined memcmp from NULL or empty buffers
erichte-ibm Aug 2, 2023
228da7e
guest/generate: free leaked memory allocated in a loop
erichte-ibm Aug 2, 2023
0dd738b
guest: use char* for strings instead of uint8_t*, replace nearly all …
erichte-ibm Aug 2, 2023
eb6ab0c
external/libstb-secvar: point libstb-secvar to a devel branch with ne…
erichte-ibm Aug 3, 2023
353d8f9
Makefile/cppcheck: force a build error if cppcheck reports any warnings
erichte-ibm Jul 26, 2023
c802444
Makefile: add formatcheck build target to check formatting without ch…
erichte-ibm Aug 2, 2023
cb912c6
CI: re-enable formatting and test case workflows
erichte-ibm Jul 20, 2023
17e20a6
CI: update Actions workflow for new Makefile build system
erichte-ibm Jul 20, 2023
051f1e4
CI: change formatting to use new formatcheck target
erichte-ibm Aug 2, 2023
b164212
CI: use apt-get instead of apt, update before install
erichte-ibm Jul 20, 2023
b06f467
CI: update checkout to v3, recursively checkout repository
erichte-ibm Aug 2, 2023
e89068a
external/libstb-secvar: bump libstb-secvar commit level to include WI…
erichte-ibm Aug 8, 2023
e437ae3
CMake: add preliminary CMake build, needs many options still
erichte-ibm Aug 4, 2023
0dcceda
Makefile: change check target dependency to depend on the binary to b…
erichte-ibm Aug 10, 2023
48cf477
CI: re-enable testing cmake builds
erichte-ibm Aug 10, 2023
2d2555e
Makefile: reenable single-backend builds
erichte-ibm Aug 17, 2023
4dd15b8
Makefile/cmake: hopefully remove weird mbedtls dependency
erichte-ibm Aug 17, 2023
6ced1d8
Makefile: split EXTERNAL_SRCS into backend-specific Makefile includes
erichte-ibm Aug 18, 2023
20bbb79
cmake: implement backend selection in cmake build
erichte-ibm Aug 18, 2023
4284099
cmake: implement crypto library selection
erichte-ibm Aug 18, 2023
c25eb0e
Makefile: implement a similar CRYPTO build option as the cmake build
erichte-ibm Aug 18, 2023
1aa62a7
Makefile: prepare for building a different flavor of libstb-secvar ba…
erichte-ibm Aug 18, 2023
14847b5
test: have directory separation for guest/host in testdata only
erichte-ibm Aug 8, 2023
65507e5
test/Makefile: update check target with new path
erichte-ibm Aug 10, 2023
a00ef9b
test/host: update paths for host tests
erichte-ibm Aug 10, 2023
cd6bb82
test/guest: update paths in guest tests
erichte-ibm Aug 10, 2023
65f5c86
test/Makefile: fix clean target for new paths
erichte-ibm Aug 15, 2023
2bf7e8b
WIP: test/generate: probably update the generate testdata scripts, ne…
erichte-ibm Aug 15, 2023
b2d4631
test/common: factor out common functions into a shared base test class
erichte-ibm Aug 15, 2023
3cee02b
test/gitignore: ignore new testdata directory, ignore pycache
erichte-ibm Aug 15, 2023
283ff7a
test/common: remove memcheck
erichte-ibm Aug 15, 2023
58f0a9a
test/common: add custom asserts for running commands, to replace getC…
erichte-ibm Aug 16, 2023
a82f57c
test/guest: replace all uses of getCmdResult with the corresponding a…
erichte-ibm Aug 16, 2023
69c1afa
test/guest: fix most major style complaints
erichte-ibm Aug 16, 2023
91cf496
test/guest: comment out unused variable assignment
erichte-ibm Aug 16, 2023
d810060
test/host: reformat host tests
erichte-ibm Aug 16, 2023
7da409e
test/host: replace easy getCmdResult() calls with assertCmd*()
erichte-ibm Aug 16, 2023
6e8b85c
test/host: call filecmp.cmp directly, replace assertEqual with assert…
erichte-ibm Aug 16, 2023
d4c074a
test/guest: remove unusued filecmp logic
erichte-ibm Aug 16, 2023
d538898
test/host_generate: reformat, same as before
erichte-ibm Aug 16, 2023
2dc3c20
test/host_generate: replace compareFiles with filecmp, assertEqual wi…
erichte-ibm Aug 16, 2023
db42f42
test/host_generate: fix default secvar tool path i guess
erichte-ibm Aug 16, 2023
b45ae18
test/host_generate: comment out unused assignments
erichte-ibm Aug 16, 2023
dafd57b
test/host_generate: remove dead code in comments
erichte-ibm Aug 16, 2023
c7fc7ee
test/host_generate: replace easy getCmdResult() calls with assertCmd*()
erichte-ibm Aug 16, 2023
81a6229
test/common: add generic assertCmd() for taking Success/Fail as an ar…
erichte-ibm Aug 16, 2023
40e575a
test/common: remove getCmdResult, replace remaining uses with assertCmd
erichte-ibm Aug 16, 2023
6c04fe4
test/common: remove all command output logging
erichte-ibm Aug 16, 2023
f777202
test/common: replace custom argparsing with environment variables, fa…
erichte-ibm Aug 17, 2023
e6a3583
test/common: Don't use capture_output
nick-child-ibm Aug 22, 2023
3ef3bb2
Add secvarctl.spec in order to build RPMs.
Aug 25, 2023
9ddaf7d
guest/util: Add crypto id to signature list
nick-child-ibm Aug 22, 2023
4352b08
libstb-secvar: update submodule commit ID
nick-child-ibm Aug 22, 2023
6c9fc0c
Makefile: Build with libstb-secvars crypto
nick-child-ibm Aug 22, 2023
9319300
Convert crypto struct names to libstb-secvar version
nick-child-ibm Aug 22, 2023
a443caa
guest/common: Replace hash_funct_t with index to list
nick-child-ibm Aug 23, 2023
bd817d8
guest: Fixup all crypto jargon to use the new direct approach
nick-child-ibm Aug 23, 2023
6a7d42e
host: Fixup crypto jargon to use libstb API
nick-child-ibm Aug 23, 2023
de9b785
Makefile: remove crypto_openssl.c from SRCS, should be included in li…
erichte-ibm Aug 29, 2023
bbdadbf
cmake: remove crypto-openssl.c from sources
erichte-ibm Aug 29, 2023
f45d1a4
external/libstb-secvar: version bump for crypto
erichte-ibm Aug 29, 2023
64b565b
tree: format fixes
erichte-ibm Aug 29, 2023
3b47192
host/validate: remove mostly unused variable from validateCertStruct
erichte-ibm Aug 29, 2023
59c7d29
guest: fix uninitialized variable
nick-child-ibm Sep 8, 2023
6df7f82
libstb-secvar: bump commit
nick-child-ibm Sep 8, 2023
a18be55
secvarctl: rewrite backend selection logic
erichte-ibm Aug 23, 2023
40a0f9d
test: only run tests if secvarctl with built with the correct backend
erichte-ibm Aug 23, 2023
39f155b
CI: split actions into separate jobs for the makefile and cmake builds
erichte-ibm Aug 23, 2023
ed6ffa4
CI: move cppcheck job to CI_formatting file
erichte-ibm Aug 23, 2023
b6b2de2
CI: enable matrix strategy for testing single-backend builds
erichte-ibm Aug 23, 2023
2c64c9d
external: use libstb-secvar's endian.h instead of carrying a duplicat…
erichte-ibm Sep 6, 2023
c8d41fc
secvarctl: display enabled backends in --help, allow empty -m to quer…
erichte-ibm Sep 7, 2023
330d18f
secvarctl: add VERSION file, display current version with --version a…
erichte-ibm Sep 13, 2023
4c865bf
spec: slight build tweaks for maximum distro compatibility
erichte-ibm Sep 13, 2023
8d6d95d
spec: update version string to semver 1.0.0
erichte-ibm Sep 13, 2023
ce675f8
CI: remove old rpmbuild workflow
erichte-ibm Sep 13, 2023
ffc7349
CI: split out building/testing and static analysis into reusable work…
erichte-ibm Sep 7, 2023
a180a56
CI: add tagged release workflow
erichte-ibm Sep 7, 2023
9fe3850
Makefile: Fix installation after source reorganization
hramrach Oct 2, 2023
1d6fdc5
guest/read: allow paths with or without a trailing slash
erichte-ibm Oct 3, 2023
adec995
guest/generate: change --append option to be a boolean based on presence
erichte-ibm Oct 4, 2023
88f29c3
guest/hash: Fix get_hash_data
nick-child-ibm Oct 5, 2023
bfc60aa
guest: Remove x509 SHA GUID functions and macros
nick-child-ibm Oct 5, 2023
61fa171
guest/generate: Fix possible memleak in is_x509certificate
nick-child-ibm Oct 5, 2023
f588e84
guest/hash: Fix validate_hash enum range conditional
nick-child-ibm Oct 6, 2023
f08bc7a
generic: change signature of print_hex to use const uint8_t
erichte-ibm Oct 6, 2023
8755b85
guest/util.h: add prlog include
erichte-ibm Oct 6, 2023
39b75fc
guest/read: rewrite print_variables function to use libstb-secvar hel…
erichte-ibm Oct 5, 2023
e2d8b5f
guest/read: split print_variables into two functions
erichte-ibm Oct 6, 2023
47a926d
guest/read: return early if next esd cannot be parsed
erichte-ibm Oct 6, 2023
1f96bad
guest/generate: reword error message for disallowing PK appends
erichte-ibm Oct 12, 2023
4f9cde2
guest/write: change signature of write_variable to use strings instea…
erichte-ibm Oct 18, 2023
74c5b43
treewide: convert buffer types to uint8_t, remove casts
erichte-ibm Oct 19, 2023
2b526dd
guest/util: remove unused constant definitions, fix signature type ta…
erichte-ibm Oct 19, 2023
edd322a
host/edk2: use struct efi_time[] as the last timestamp type instead o…
erichte-ibm Oct 19, 2023
756a27f
Makefile: ignore ccan headers in cppcheck
erichte-ibm Oct 19, 2023
f52c9ab
guest: constify variables, parameters to appease cppcheck
erichte-ibm Oct 19, 2023
f47dc87
guest/read: reduce scope of sig_type insie print_esl_buffer
erichte-ibm Oct 19, 2023
a20a28b
host/verify: adjust prlog formats to use appropriate type specifier f…
erichte-ibm Oct 19, 2023
1ba77a4
external/skiboot: commented out global extern definitions in secvar.h
erichte-ibm Oct 25, 2023
84e61df
Makefile/cppcheck: suppress unmatched suppression warnings
erichte-ibm Oct 25, 2023
42daa48
guest/generate: fix potential null reference in pk/append special case
erichte-ibm Oct 25, 2023
1030894
guest: add timestamp print output to read/verify commands
SudhakarKuppusamy1 Oct 25, 2023
12ebd63
Guest/Verify: -w option allowed when use -u with -p
SudhakarKuppusamy1 Oct 25, 2023
0d274ba
Guest/generate: trustedcadb variable allow only CA certificates
SudhakarKuppusamy1 Oct 26, 2023
c9aff28
Guest/verify: corrected typo error
SudhakarKuppusamy1 Oct 26, 2023
e8a9ad0
Guest/verify: fix misbehaviour of verify and write with -p
SudhakarKuppusamy1 Oct 26, 2023
8bf024b
guest/verify: only print default PK in get_current_esl_data if verbos…
erichte-ibm Nov 22, 2023
f8cc95f
guest: replace TIMESTAMP_LEN with actual sized structs
erichte-ibm Nov 22, 2023
6f4d730
generic: fix static builds by removing unnecessary header include
erichte-ibm Dec 8, 2023
2279911
test/guest: fix incorrect cert file extension
erichte-ibm Jan 2, 2024
ae6fa1c
guest/read: fix segfault in read -c caused by empty variable name
erichte-ibm Jan 2, 2024
b7f75be
guest/generate: fix PK append flag error being printed multiple times
erichte-ibm Jan 3, 2024
4fbd198
guest/generate: fix multiple input/output format specifier argument p…
erichte-ibm Jan 3, 2024
613bd68
test: handle exiting via signal as a failure regardless of assertCmd …
erichte-ibm Jan 10, 2024
28e3d3b
external/libstb-secvar: bump commit level to post-merge main
erichte-ibm Feb 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 0 additions & 21 deletions .github/workflows/CI_formatting.yml

This file was deleted.

165 changes: 0 additions & 165 deletions .github/workflows/build_rpm.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: x86 Make CI

on: "workflow_call"

jobs:
makefile:
strategy:
matrix:
backend: ["", "GUEST_BACKEND=0", "HOST_BACKEND=0"]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: install openssl and valgrind for running test script
run: sudo apt-get update && sudo apt-get install -y openssl libssl-dev libmbedtls-dev

- name: run test cases
run: make ${{ matrix.backend }} check

cmake:
strategy:
matrix:
backend: ["", "-DGUEST_BACKEND=0", "-DHOST_BACKEND=0"]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: install openssl and valgrind for running test script
run: sudo apt-get update && sudo apt-get install -y openssl libssl-dev libmbedtls-dev cmake

- name: generate cmake build
run: cmake -Bbuild . -DUSE_ASAN=ON -DCMAKE_BUILD_TYPE=Debug ${{ matrix.backend }}

- name: run cmake build
run: cmake --build build

- name: run test cases
run: make check SECVAR_TOOL=$(pwd)/build/secvarctl
32 changes: 32 additions & 0 deletions .github/workflows/format_static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Format Check and Static Analysis

on: "workflow_call"

jobs:
formatcheck:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: install clang format
run: sudo apt-get update && sudo apt-get install -y clang-format

- name: test if formatting is appropriate
run: make formatcheck

cppcheck:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck

- name: run cppcheck
run: make cppcheck
16 changes: 16 additions & 0 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build and Test

on:
push:
tags:
- "!v*"
branches:
- "**"
pull_request:

jobs:
tests:
uses: ./.github/workflows/build_test.yml

static:
uses: ./.github/workflows/format_static.yml
99 changes: 99 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Generate Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
tests:
uses: ./.github/workflows/build_test.yml

static:
uses: ./.github/workflows/format_static.yml

rpmbuild:
runs-on: ubuntu-latest
needs: ["tests", "static"]
strategy:
fail-fast: false
matrix:
arch: ["x86_64", "ppc64le"]
image:
- "almalinux:8"
- "almalinux:9"
- "fedora:37"
- "fedora:38"
- "fedora:rawhide"
- "opensuse/leap:15"
- "opensuse/tumbleweed:latest"
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: prepare qemu
uses: docker/setup-qemu-action@v2
with:
platforms: "${{ matrix.arch }}"

- run: echo IMAGE_NAME=$(echo ${{ matrix.image }} | sed "s/:/_/g")-${{ matrix.arch }} >> $GITHUB_ENV

- name: build docker image
run: docker build -t ${IMAGE_NAME} --platform linux/${{ matrix.arch }} --build-arg="BUILD_IMAGE=${{ matrix.image }}" -f ci/Dockerfile .

- name: run docker build
run: docker run -t --platform linux/${{ matrix.arch }} -v $(pwd):/build ${IMAGE_NAME} bash -c "cd build && ci/build-rpm.sh"

- name: upload rpms
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch }}
path: rpms/*

staticbuild:
runs-on: ubuntu-latest
needs: ["tests", "static"]
strategy:
fail-fast: true
matrix:
arch: ["x86_64", "ppc64le"]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- uses: docker/setup-qemu-action@v2
with:
platforms: "${{ matrix.arch }}"

- name: build docker image
run: docker build -t alpine-${{ matrix.arch }} --platform linux/${{ matrix.arch }} -f ci/Dockerfile.alpine .

- name: run docker build
run: docker run -t --platform linux/${{ matrix.arch }} -v $(pwd):/build -e ARCH=${{ matrix.arch }} alpine-${{ matrix.arch }} bash -c "cd build && ci/build-static.sh"

- name: upload rpms
uses: actions/upload-artifact@v3
with:
name: static
path: secvarctl.${{ matrix.arch }}

release:
runs-on: ubuntu-latest
needs: ["rpmbuild", "staticbuild"]
steps:
- name: download rpms
uses: actions/download-artifact@v3

- name: generate release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ contains(github.ref_name, '-') }}
files: |
*/*.rpm
static/*
Loading
Loading