Skip to content

Release

Release #3

Workflow file for this run

name: Release
permissions:
contents: read
on:
push:
tags:
- v*
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
name: Build and Publish
if: ${{ !contains(github.event.head_commit.message, '#skip') }}
strategy:
fail-fast: true
matrix:
include:
- target: windows
os: windows-latest
- target: linux
os: ubuntu-latest
- target: macos
os: macos-latest
- target: jvm
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '16'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Assemble project
run: |
if [ ${{ matrix.target }} == jvm ]; then
./gradlew jvmJar
else
case ${{ matrix.os }} in
windows-latest)
./gradlew compileKotlinMingwX64
;;
ubuntu-latest)
./gradlew compileKotlinLinuxX64 compileKotlinLinuxArm64
;;
macos-latest)
./gradlew compileKotlinMacosX64 compileKotlinMacosArm64
;;
esac
fi
publish:
name: Publish
needs: build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '16'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}