Skip to content

Github Actions

Github Actions #4

Workflow file for this run

name: PerfIO Release
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: |
21
23
distribution: 'temurin'
cache: 'sbt'
- name: Set up sbt
uses: sbt/setup-sbt@v1
- name: Set up secrets
env:
SIGNING_KEY_PRIVATE: ${{ secrets.SIGNING_KEY_PRIVATE }}
SIGNING_KEY_PUBLIC: ${{ secrets.SIGNING_KEY_PUBLIC }}
PUBLISHING_CREDENTIALS: ${{ secrets.PUBLISHING_CREDENTIALS }}
run: |
echo "$SIGNING_KEY_PUBLIC" | gpg --import
mkdir -p ~/.gnupg/private-keys-v1.d # workaround for a gpg bug
echo "$SIGNING_KEY_PRIVATE" | gpg --passphrase=${{ secrets.SIGNING_KEY_PASSPHRASE }} --pinentry-mode=loopback --batch --import
echo "$PUBLISHING_CREDENTIALS" >publishing-credentials
- name: Build
env:
PGP_PASSPHRASE: ${{ secrets.SIGNING_KEY_PASSPHRASE }}
run: |
# Publish binaries with Java 21 (because we can't use --enable-preview for 21 from 23)
JAVA_HOME=$JAVA_HOME_21_X64 JAVA_OPTS=--enable-preview sbt \
"set core/Compile/packageDoc/publishArtifact := false" \
core/publishSigned
# Publish javadoc with Java 23 (because we need Markdown support)
JAVA_HOME=$JAVA_HOME_23_X64 sbt \
"set core/Compile/packageSrc/publishArtifact := false" \
"set core/Compile/packageBin/publishArtifact := false" \
core/publishSigned
if [[ -d target/sonatype-staging ]]; then
ls -lR target/sonatype-staging
JAVA_HOME=$JAVA_HOME_23_X64 sbt sonatypeCentralUpload
fi