Skip to content

build: replace custom BuildConfig task with BuildKonfig #20

build: replace custom BuildConfig task with BuildKonfig

build: replace custom BuildConfig task with BuildKonfig #20

Workflow file for this run

name: Build Desktop Distributions
on:
push:
tags:
- 'v*' # Runs on version tags like v1.0.0
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# macOS ARM (Apple Silicon)
- os: macos-latest
format: macos-arm
arch_label: macos-arm64
# macOS Intel (x64)
- os: macos-15-intel
format: macos-intel
arch_label: macos-x64
# Windows
- os: windows-latest
format: windows
arch_label: windows-x64
# Linux
- os: ubuntu-latest
format: linux
arch_label: linux-amd64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for Gradlew
if: runner.os != 'Windows'
run: chmod +x gradlew
- name: Inject release props
shell: bash
env:
SENTRY_DNS: ${{ secrets.SENTRY_DNS }}
run: |
MAJOR=$(grep "MAJOR=" version.properties | cut -d'=' -f2)
MINOR=$(grep "MINOR=" version.properties | cut -d'=' -f2)
PATCH=$(grep "PATCH=" version.properties | cut -d'=' -f2)
VERSION="$MAJOR.$MINOR.$PATCH"
echo "is_release=true" > composeApp/src/jvmMain/resources/props.properties
echo "sentry_dns=$SENTRY_DNS" >> composeApp/src/jvmMain/resources/props.properties
echo "version=$VERSION" >> composeApp/src/jvmMain/resources/props.properties
- name: Build native packages
run: ./gradlew packageReleaseDistributionForCurrentOS --stacktrace
# macOS ARM
- name: Rename macOS ARM DMG
if: matrix.format == 'macos-arm'
run: |
FILE=$(find composeApp/build/compose/binaries -name "*.dmg" -type f)
NEW="DevAnalyzer-${{ github.ref_name }}-macos-arm64.dmg"
mv "$FILE" "$(dirname "$FILE")/$NEW"
# macOS Intel
- name: Rename macOS Intel DMG
if: matrix.format == 'macos-intel'
run: |
FILE=$(find composeApp/build/compose/binaries -name "*.dmg" -type f)
NEW="DevAnalyzer-${{ github.ref_name }}-macos-x64.dmg"
mv "$FILE" "$(dirname "$FILE")/$NEW"
# Windows
- name: Rename Windows MSI
if: matrix.format == 'windows'
shell: pwsh
run: |
$file = Get-ChildItem -Recurse -Filter *.msi -Path "composeApp/build/compose/binaries" | Select-Object -First 1
$newName = "DevAnalyzer-${{ github.ref_name }}-windows-x64.msi"
Rename-Item -Path $file.FullName -NewName $newName
# Linux
- name: Rename Linux DEB
if: matrix.format == 'linux'
run: |
FILE=$(find composeApp/build/compose/binaries -name "*.deb" -type f)
NEW="DevAnalyzer-${{ github.ref_name }}-linux-amd64.deb"
mv "$FILE" "$(dirname "$FILE")/$NEW"
# Upload renamed artifacts
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.format }}
path: |
composeApp/build/compose/binaries/**/dmg/*.dmg
composeApp/build/compose/binaries/**/deb/*.deb
composeApp/build/compose/binaries/**/msi/*.msi
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: List downloaded files
run: ls -R ./artifacts
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/build-macos-arm/**/*.dmg
artifacts/build-macos-intel/**/*.dmg
artifacts/build-windows/**/*.msi
artifacts/build-linux/**/*.deb
draft: true
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}