Desktop release #3
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: 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 | |
with: | |
gradle-home-cache-cleanup: true | |
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} | |
- 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 | |
with: | |
gradle-home-cache-cleanup: true | |
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} | |
- 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 | |
tag_and_create_release: | |
needs: [ build_msi, build_linux_x64_uber_jar ] | |
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: Tag Release | |
run: | | |
git config --local user.email "action@github.com" | |
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" | |
draft: true | |
name: "[JVM] ${{ github.event.inputs.version }}" | |
tag: jvm-${{ github.event.inputs.version }} |