Skip to content

Release

Release #38

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
candidate:
type: choice
description: Choose a candidate
options:
- RC
- GA
rc_version:
type: string
default: ''
description: 'If candidate is RC, set a version like RC1 or RC2, else leave it empty'
env:
JAVA_RELEASE: '23'
JAVA_VERSION: '23.0.1'
JAVAFX_VERSION: '23.0.1'
jobs:
precheck:
runs-on: ubuntu-20.04
outputs:
JAVA_RELEASE: ${{ env.JAVA_RELEASE }}
JAVA_VERSION: ${{ env.JAVA_VERSION }}
JAVAFX_VERSION: ${{ env.JAVAFX_VERSION }}
APP_VERSION: ${{ steps.vars.outputs.APP_VERSION }}
PROJECT_VERSION: ${{ steps.vars.outputs.PROJECT_VERSION }}
S3_PATH: ${{ steps.vars.outputs.S3_PATH }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java
uses: oracle-actions/[email protected]
with:
website: jdk.java.net
release: ${{ env.JAVA_RELEASE }}
version: ${{ env.JAVA_VERSION }}
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set environment
id: vars
shell: bash
run: |
mvn -B -ntp -q versions:set -DremoveSnapshot -DgenerateBackupPoms=false
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
APP_VERSION=$PROJECT_VERSION
S3_PATH=$PROJECT_VERSION
CANDIDATE=${{ github.event.inputs.candidate }}
if [[ "$CANDIDATE" == RC ]]; then
RC_VERSION = ${{ github.event.inputs.rc_version }}
if [[ "$RC_VERSION" == "" ]]; then
RC_VERSION = "RC"
fi
PROJECT_VERSION=${PROJECT_VERSION}-${RC_VERSION}
S3_PATH=RC/$PROJECT_VERSION
fi
echo "Releasing.. "$PROJECT_VERSION
echo APP_VERSION=$APP_VERSION >> $GITHUB_OUTPUT
echo PROJECT_VERSION=$PROJECT_VERSION >> $GITHUB_OUTPUT
echo S3_PATH=$S3_PATH >> $GITHUB_OUTPUT
linux-bundles:
needs: [precheck]
uses: ./.github/workflows/bundles-linux.yml
with:
javafx-version: ${{ needs.precheck.outputs.JAVAFX_VERSION }}
java-version: ${{ needs.precheck.outputs.JAVA_VERSION }}
app-version: ${{ needs.precheck.outputs.APP_VERSION }}
project-version: ${{ needs.precheck.outputs.PROJECT_VERSION }}
test: true
windows-bundles:
needs: [precheck]
uses: ./.github/workflows/bundles-windows.yml
secrets:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_PASSWORD: ${{ secrets.WINDOWS_PASSWORD }}
WINDOWS_CERTNAME: ${{ secrets.WINDOWS_CERTNAME }}
with:
javafx-version: ${{ needs.precheck.outputs.JAVAFX_VERSION }}
java-version: ${{ needs.precheck.outputs.JAVA_VERSION }}
app-version: ${{ needs.precheck.outputs.APP_VERSION }}
project-version: ${{ needs.precheck.outputs.PROJECT_VERSION }}
test: true
mac-bundles:
needs: [precheck]
uses: ./.github/workflows/bundles-mac.yml
secrets:
CERTIFICATES_FILE_BASE64: ${{ secrets.CERTIFICATES_FILE_BASE64 }}
CERTIFICATES_PASSWORD: ${{ secrets.CERTIFICATES_PASSWORD }}
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
MACSIGN_USER: ${{ secrets.GLUON_MACSIGN_USER }}
MACSIGN_PREFIX: ${{ secrets.GLUON_MACSIGN_PREFIX }}
with:
javafx-version: ${{ needs.precheck.outputs.JAVAFX_VERSION }}
java-version: ${{ needs.precheck.outputs.JAVA_VERSION }}
app-version: ${{ needs.precheck.outputs.APP_VERSION }}
project-version: ${{ needs.precheck.outputs.PROJECT_VERSION }}
test: true
mac_aarch64-bundles:
needs: [precheck]
uses: ./.github/workflows/bundles-mac_aarch64.yml
secrets:
CERTIFICATES_FILE_BASE64: ${{ secrets.CERTIFICATES_FILE_BASE64 }}
CERTIFICATES_PASSWORD: ${{ secrets.CERTIFICATES_PASSWORD }}
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
MACSIGN_USER: ${{ secrets.GLUON_MACSIGN_USER }}
MACSIGN_PREFIX: ${{ secrets.GLUON_MACSIGN_PREFIX }}
with:
javafx-version: ${{ needs.precheck.outputs.JAVAFX_VERSION }}
java-version: ${{ needs.precheck.outputs.JAVA_VERSION }}
app-version: ${{ needs.precheck.outputs.APP_VERSION }}
project-version: ${{ needs.precheck.outputs.PROJECT_VERSION }}
test: true
kit-bundles:
needs: [precheck]
uses: ./.github/workflows/bundles-kit.yml
with:
java-version: ${{ needs.precheck.outputs.JAVA_VERSION }}
project-version: ${{ needs.precheck.outputs.PROJECT_VERSION }}
release:
needs: [precheck, linux-bundles, windows-bundles, mac-bundles, mac_aarch64-bundles, kit-bundles]
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: oracle-actions/[email protected]
with:
website: jdk.java.net
release: ${{ needs.precheck.outputs.JAVA_RELEASE }}
version: ${{ needs.precheck.outputs.JAVA_VERSION }}
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Set Release Version
run: |
mvn -B -ntp -q versions:set -DnewVersion=${{ needs.precheck.outputs.PROJECT_VERSION }} -DgenerateBackupPoms=false
mvn -pl :parent process-resources
- name: Deploy parent pom and Kit to local staging
run: |
mvn -B -ntp deploy -pl :parent -Dmaven.test.skip=true
mvn -B -ntp deploy -fkit -Dmaven.test.skip=true
- name: Release with JReleaser
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_S3_GLUON_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
JRELEASER_S3_GLUON_SECRET_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
JRELEASER_S3_GLUON_REGION: us-east-1
JRELEASER_S3_GLUON_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
run: |
FILES_ACTIVE="RELEASE"
if [[ "$PROJECT_VERSION" == *-RC* ]]; then
FILES_ACTIVE="NEVER"
fi
mvn -B -ntp -pl :parent -DartifactsDir=artifacts -Ds3Path=${{ needs.precheck.outputs.S3_PATH }} \
-Djreleaser.files.active=$FILES_ACTIVE jreleaser:release
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-logs
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties