ci: create workflows for doing github releases #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create a GitHub release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
branches: | |
- "ci/create-releases" | |
jobs: | |
maven: | |
name: Maven | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Build and test | |
run: | | |
sudo apt install -y softhsm2 | |
mkdir tokens | |
export SOFTHSM2_CONF=${GITHUB_WORKSPACE}/softhsm2.conf | |
echo "directories.tokendir = ${GITHUB_WORKSPACE}/tokens" > softhsm2.conf | |
echo "log.level = DEBUG" > softhsm2.conf | |
SLOT_ID=$(softhsm2-util --init-token --free --label "test" --pin 1234 --so-pin 1234 | tail -n 1 | awk '{ print $NF }') | |
export JACKNJI11_TEST_TESTSLOT="$SLOT_ID" | |
export JACKNJI11_TEST_INITSLOT="$SLOT_ID" | |
export JACKNJI11_TEST_USER_PIN=1234 | |
export JACKNJI11_TEST_SO_PIN=1234 | |
export JACKNJI11_PKCS11_LIB_PATH=/usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so | |
mvn --no-transfer-progress package | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: target/*.jar |