Skip to content

Commit

Permalink
whoa
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Richter <[email protected]>
  • Loading branch information
erichte-ibm committed Aug 30, 2023
1 parent 1e6a07c commit e848a38
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 7 deletions.
46 changes: 39 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,57 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ["x86_64", "ppc64le"]

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

- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y openssl libssl-dev
# TODO: maybe this doesn't need to be matrixed so it can be cached?
- name: prepare qemu
uses: docker/setup-qemu-action@v2
with:
platforms: ["${{ matrix.arch }}"]

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

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

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

- name: build binary
run: make
# - name: install dependencies
# run: sudo apt-get update && sudo apt-get install -y openssl libssl-dev

- name: run tests
run: make SECVAR_TOOL=$(pwd)/bin/secvarctl check
# - name: build binary
# run: make

# - name: run tests
# run: make SECVAR_TOOL=$(pwd)/bin/secvarctl check

# - name: rename binary
# run: cp bin/secvarctl secvarctl.x86_64

# - name: build rpm
# run:

release:
runs-on: ubuntu-latest
needs: build
steps:
- name: download rpms
uses: actions/download-artifact@v3

- name: generate release
uses: softprops/action-gh-release@v1
with:
files: |
bin/secvarctl
*.rpm
4 changes: 4 additions & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM almalinux:8
#RUN yum -y update && yum clean all
RUN yum -y install cmake openssl openssl-devel gcc rpm-build

22 changes: 22 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

VERSION=1.0

if [ -z ${ARCH}]; then
echo "ARCH must be set to a valid rpm build architecture"
exit
fi

# Generate source tarball
ln -s . secvarctl-${VERSION}
tar czf secvarctl-${VERSION}.tar.gz secvarctl-${VERSION}.tar.gz
mkdir -p /root/rpmbuild/SOURCES

# Run Build
rpmbuild -ba secvarctl.spec

# Move generated RPMs out of container
mkdir -p rpms
cp /root/rpmbuild/RPMS/${ARCH}/*.rpm rpms/
cp /root/rpmbuild/SRPMS/*.rpm rpms/
# Note: srpm s the same for all arches, so really only the first to complete needs to be done

0 comments on commit e848a38

Please sign in to comment.