Skip to content

Commit

Permalink
Update githubactions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Aug 14, 2024
1 parent aa6947d commit 1dcecbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 70 deletions.
74 changes: 6 additions & 68 deletions .github/workflows/release_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,6 @@ on: [push]

jobs:

Ubuntu2004-Build:
name: Ubuntu2004
runs-on: ubuntu-20.04
env:
YUBIHSMSDK_VERSION: 2021-08

steps:
- name: Checkout repository
uses: actions/checkout@v2

# download yubihsm-sdk installer from dev.y.c and install it
- name: install yubihsm-shell
run: |
set -e -o pipefail
set -x
cd ..
curl -L --max-redirs 2 -o - https://developers.yubico.com/YubiHSM2/Releases/yubihsm2-sdk-$YUBIHSMSDK_VERSION-ubuntu2004-amd64.tar.gz |\
tar -xzvf -
cd yubihsm2-sdk
sudo dpkg -i ./libyubihsm*_amd64.deb
- name: clone yubihsmrs
run: |
set -e -o pipefail
set -x
cd ..
git clone https://github.com/Yubico/yubihsmrs.git
- name: Build yubihsm-setup
run: |
set -e -o pipefail
set -x
mkdir -p artifact/yubihsm-setup
cd ..
export PATH=$PATH:~/.cargo/bin
if [[ ! -x $(command -v rustc) ]]; then
curl -o rustup.sh https://sh.rustup.rs
bash ./rustup.sh -y
fi
cargo install cargo-deb
cd yubihsm-setup
YUBIHSM_LIB_DIR=$(dpkg -L libyubihsm1 | grep -e "libyubihsm.so.2$" | xargs dirname) cargo build --release
strip --strip-all target/release/yubihsm-setup
cargo deb --no-build
cp target/debian/*.deb artifact/yubihsm-setup/
./target/release/yubihsm-setup --version
./target/release/yubihsm-setup --help
LICENSE_DIR="artifact/yubihsm-setup/share/yubihsm-setup"
mkdir -p $LICENSE_DIR
cp -r resources/release/licenses $LICENSE_DIR/
for lf in $LICENSE_DIR/licenses/*; do
chmod 644 $lf
done
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubihsm-setup-ubuntu2004-amd64
path: artifact

debian_based:
strategy:
fail-fast: false
Expand Down Expand Up @@ -242,13 +176,17 @@ jobs:
run: |
dnf -y update
dnf -y install binutils \
gcc \
gcc-c++ \
git \
chrpath \
cmake \
openssl-devel \
libusb1-devel \
libedit-devel \
libcurl-devel \
rpmdevtools \
pcsc-lite-devel
pcsc-lite-devel \
libusb1-devel \
curl -o rustup.sh https://sh.rustup.rs
bash ./rustup.sh -y
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- name: install libyubihsm
run: |
cd ..
git clone https://github.com/Yubico/yubihsm-shell.git
cd yubihsm-shell
mkdir build
Expand All @@ -50,15 +51,15 @@ jobs:
- name: clone yubihsmrs
run: |
cd ..
git clone https://github.com/Yubico/yubihsmrs.git
- name: Build yubihsm-setup
run: |
set -e -o pipefail
set -x
mkdir artifact
mkdir $GITHUB_WORKSPACE/artifact
cd yubihsm-setup
RUSTFLAGS="-C link-args=-Wl,-rpath,\$ORIGIN/../lib" YUBIHSM_LIB_DIR=$GITHUB_WORKSPACE/yubihsm-shell/build/lib cargo build --release
strip -u -r target/release/yubihsm-setup
install target/release/yubihsm-setup ../artifact
Expand Down

0 comments on commit 1dcecbb

Please sign in to comment.