Publish to Maven Central #15
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: Publish to Maven Central | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
publish: | |
strategy: | |
matrix: | |
scala-version: ['2.12'] #, '2.13'] | |
spark-version: ["3.2.0"] #, "3.3.0", "3.4.0", "3.5.0"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: 'sbt' | |
- name: Set JVM Options # Checkita uses some compile-heavy libraries. | |
run: | | |
echo "-Xmx2G" > .jvmopts | |
echo "-Xms1G" >> .jvmopts | |
echo "-Xss100m" >> .jvmopts | |
- name: Set GPG Key # Import GPG Key and trust it. Then list key for debug purposes. | |
run: | | |
echo -n "$GPG_KEY" | base64 --decode | gpg --batch --passphrase $GPG_PASS --import | |
echo "$GPG_TRUST" | gpg --import-ownertrust | |
gpg --list-keys | |
env: | |
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_TRUST: ${{ secrets.GPG_OWNERTRUST }} | |
GPG_PASS: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Set SBT Credentials | |
run: | | |
mkdir -p ~/.sbt | |
echo "realm=Sonatype Central Portal" > ~/.sbt/.credentials | |
echo "host=central.sonatype.com" >> ~/.sbt/.credentials | |
echo "user=$ST_USER" >> ~/.sbt/.credentials | |
echo "password=$ST_PASSWORD" >> ~/.sbt/.credentials | |
env: | |
ST_USER: ${{ secrets.SONATYPE_USER }} | |
ST_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
- name: Compile and Publish for Scala ${{ matrix.scala-version }} and Spark ${{ matrix.spark-version }} | |
run: | | |
export GPG_TTY=$(tty) | |
sbt \ | |
-DASSY_MODE=WITHSPARK \ | |
-DSCALA_VERSION=$SCALA_VER \ | |
-DSPARK_VERSION=$SPARK_VER \ | |
-DPUBLISH_REALM=$REALM \ | |
-DPUBLISH_URL=$URL \ | |
-DPKG_TYPE=$PKG \ | |
checkita-core/clean \ | |
checkita-core/compile \ | |
checkita-core/publishSigned \ | |
sonatypeCentralUpload | |
env: | |
SCALA_VER: ${{ matrix.scala-version }} | |
SPARK_VER: ${{ matrix.spark-version }} | |
PGP_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} # required for sbt-pgp plugin to sign package | |
REALM: Sonatype | |
URL: https://central.sonatype.com | |
PKG: RELEASE | |