Skip to content

Desktop release

Desktop release #10

name: Desktop release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
code_quality:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Unit tests
run: ./gradlew test
build_msi:
needs: code_quality
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build MSI
run: |
./gradlew :desktopApp:packageReleaseMsi
- name: Upload MSI
uses: actions/upload-artifact@v4
with:
name: CPU.Info-${{ github.event.inputs.version }}.msi
path: desktopApp/build/compose/binaries/main-release/msi/*.msi
build_linux_x64_uber_jar:
needs: code_quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build Uber JAR
run: ./gradlew :desktopApp:packageReleaseUberJarForCurrentOS
- name: Upload Uber JAR
uses: actions/upload-artifact@v4
with:
name: CPU-Info-linux-x64-${{ github.event.inputs.version }}-release.jar
path: desktopApp/build/compose/jars/*.jar
build_mac_dmg:
needs: code_quality
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 18
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 18
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Cache KMP tooling
uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-v1-${{ hashFiles('*.versions.toml') }}
- name: Import certs
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.MAC_NOTARIZATION_CERT }}
p12-password: ${{ secrets.MAC_NOTARIZATION_CERT_PASS }}
- name: Create path variables
id: path_variables
run: |
name="CPU-Info-${{ github.event.inputs.version }}.dmg"
path="desktopApp/build/compose/binaries/main-release/dmg/${name}"
echo "RELEASE_NAME=$name" >> $GITHUB_ENV
echo "RELEASE_PATH=$path" >> $GITHUB_ENV
- name: Create and notarize DMG
run: |
./gradlew desktopApp:notarizeReleaseDmg -PmacOsNotarization=true \
-Pcompose.desktop.mac.notarization.appleID=$MAC_NOTARIZATION_ID \
-Pcompose.desktop.mac.notarization.password=$MAC_NOTARIZATION_PWD \
-Pcompose.desktop.mac.notarization.teamID=$MAC_APPSTORE_TEAM_ID
env:
MAC_NOTARIZATION_ID: ${{ secrets.MAC_NOTARIZATION_ID }}
MAC_NOTARIZATION_PWD: ${{ secrets.MAC_NOTARIZATION_PWD }}
MAC_APPSTORE_TEAM_ID: ${{ secrets.MAC_APPSTORE_TEAM_ID }}
RELEASE_PATH: ${{ env.RELEASE_PATH }}
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}
path: ${{ env.RELEASE_PATH }}
tag_and_create_release:
needs: [ build_msi, build_linux_x64_uber_jar, build_mac_dmg ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download MSI
uses: actions/download-artifact@v4
with:
name: CPU.Info-${{ github.event.inputs.version }}.msi
- name: Download Linux x64 Uber JAR
uses: actions/download-artifact@v4
with:
name: CPU-Info-linux-x64-${{ github.event.inputs.version }}-release.jar
- name: Download DMG
uses: actions/download-artifact@v4
with:
name: CPU-Info-${{ github.event.inputs.version }}.dmg
- name: Tag Release
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git tag jvm-${{ github.event.inputs.version }}
git push origin jvm-${{ github.event.inputs.version }}
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "*.msi, *.jar, *.dmg"
draft: true
name: "[JVM] ${{ github.event.inputs.version }}"
tag: jvm-${{ github.event.inputs.version }}