Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
workflow_dispatch
jobs:
create_staging_repository:
runs-on: ubuntu-latest
name: Create staging repository
outputs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/create-nexus-staging-repo@main
with:
username: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
password: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }}
# Defaults to the https://oss.sonatype.org, not https://s01.oss.sonatype.org
base_url: https://s01.oss.sonatype.org/service/local/
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}
release:
needs: [create_staging_repository]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
include:
- os: ubuntu-latest
# On ubuntu publish everything you can i.e. the linuxX64 and jvm binaries
# (Need to do >- or for some reason it preserves a newline after all the entries)
publish_command: >-
:terpal-sql-core:publishAllPublicationsToOss
:terpal-sql-jdbc:publishAllPublicationsToOss
:terpal-sql-native:publishAllPublicationsToOss
:terpal-sql-android:publishAllPublicationsToOss
platform: linux
- os: macOS-latest
# (Need to do >- or for some reason it preserves a newline after all the entries)
publish_command: >-
:terpal-sql-core:publishMacosX64PublicationToOss
:terpal-sql-core:publishMacosArm64PublicationToOss
:terpal-sql-core:publishIosX64PublicationToOss
:terpal-sql-core:publishIosArm64PublicationToOssRepository
:terpal-sql-core:publishIosSimulatorArm64PublicationToOss
:terpal-sql-core:publishTvosX64PublicationToOss
:terpal-sql-core:publishTvosArm64PublicationToOss
:terpal-sql-core:publishWatchosX64PublicationToOss
:terpal-sql-core:publishWatchosArm32PublicationToOss
:terpal-sql-core:publishWatchosArm64PublicationToOss
:terpal-sql-native:publishMacosX64PublicationToOss
:terpal-sql-native:publishMacosArm64PublicationToOss
:terpal-sql-native:publishIosX64PublicationToOss
:terpal-sql-native:publishIosArm64PublicationToOssRepository
:terpal-sql-native:publishIosSimulatorArm64PublicationToOss
:terpal-sql-native:publishTvosX64PublicationToOss
:terpal-sql-native:publishTvosArm64PublicationToOss
:terpal-sql-native:publishWatchosX64PublicationToOss
:terpal-sql-native:publishWatchosArm32PublicationToOss
:terpal-sql-native:publishWatchosArm64PublicationToOss
platform: mac
- os: windows-latest
publish_command: >-
:terpal-sql-core:publishMingwX64PublicationToOss
:terpal-sql-native:publishMingwX64PublicationToOss
platform: windows
env:
SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }}
SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
NEW_SIGNING_KEY_ID_BASE64: ${{ secrets.NEW_SIGNING_KEY_ID_BASE64 }}
NEW_SIGNING_KEY_ID_BASE64_PASS: ${{ secrets.NEW_SIGNING_KEY_ID_BASE64_PASS }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- run: echo "*************** PublishCommand ${{ matrix.publish_command }}"
- name: 'Run Jdbc, Android, and Native-Linux Tests'
if: matrix.os == 'ubuntu-latest'
run: >-
docker compose build && docker compose run --rm --service-ports setup &&
./gradlew build ${{ matrix.publish_command }} -Pplatform=${{ matrix.platform }} -PisCI -no-daemon --stacktrace
- name: 'Run MacOS Tests'
if: matrix.os == 'macOS-latest'
run: ./gradlew :terpal-sql-native:build ${{ matrix.publish_command }} -Pplatform=${{ matrix.platform }} -PisCI -no-daemon --stacktrace
- name: 'Run windows tests'
if: matrix.os == 'windows-latest'
run: ./gradlew :terpal-sql-native:mingwX64Test ${{ matrix.publish_command }} -Pplatform=${{ matrix.platform }} -PisCI -no-daemon --stacktrace