Skip to content

Commit

Permalink
Merge pull request #15 from recke96/release-flow
Browse files Browse the repository at this point in the history
Release flow
  • Loading branch information
recke96 authored Mar 15, 2024
2 parents 0c53952 + 5a01175 commit d9e6adc
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 9 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ permissions:
security-events: write

jobs:
build:
check:
runs-on: "ubuntu-latest"
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false

steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
Expand All @@ -32,9 +30,6 @@ jobs:
dependency-graph: generate-and-submit
- name: Check
run: ./gradlew check --continue
- name: Merge SARIF
if: success() || failure()
run: ./gradlew mergeSarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release

on:
workflow_dispatch:
inputs:
bump:
description: Which part of the version to bump
required: true
default: patch
type: choice
options:
- patch
- minor
- major

jobs:
package:
strategy:
matrix:
variant:
- { os: windows-latest, package: exe }
- { os: ubuntu-latest, package: deb }
runs-on: ${{ matrix.variant.os }}
steps:
- uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Build & Package
run: ./gradlew packageDistributionForCurrentOS
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.variant.package }}
path: ${{ github.workspace }}/desktop-app/build/compose/binaries/main/${{ matrix.variant.package }}/*.${{ matrix.variant.package }}

release:
needs: [package]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: ${{ github.workspace }}/packages
- name: Display
run: ls -R ${{ github.workspace }}
- id: release
name: Create Release
uses: rymndhng/[email protected]
with:
name: HEMAtoma <RELEASE_VERSION>
bump_version_scheme: ${{ inputs.bump }}
use_github_release_notes: true
- name: Upload Release Artifacts
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release.outputs.tag_name }}
files: |
${{ github.workspace }}/packages/*.deb
${{ github.workspace }}/packages/*.exe
14 changes: 14 additions & 0 deletions .github/workflows/validate-wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate Gradle Wrapper

on:
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions desktop-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.ksp)
alias(libs.plugins.kotlin.compose)
}

version = "0.2.0"

kotlin {
jvmToolchain(21)
}
Expand All @@ -18,7 +22,7 @@ dependencies {
implementation(compose.materialIconsExtended)
implementation(libs.filepicker)
implementation(libs.datatable)

implementation(libs.bundles.arrow)
ksp(libs.arrow.optics.ksp)

Expand All @@ -30,14 +34,27 @@ dependencies {

implementation(libs.flogger)
runtimeOnly(libs.flogger.backend)

detektPlugins(libs.detekt.compose)
detektPlugins(libs.detekt.arrow)
}

compose.desktop {
application {
mainClass = "info.marozzo.hematoma.MainKt"

nativeDistributions {
targetFormats(TargetFormat.Deb, TargetFormat.Exe)
packageName = rootProject.name
description = "Tournament planner for HEMA tournaments of the club 'Fior della Spada'"
copyright = "© 2024 Jakob Ecker. All rights reserved."
licenseFile = rootProject.file("LICENCE")

windows {
console = false
upgradeUuid = "{31E152a4-C1A7-4465-9891-5CC18E54851B}"
}
}
}
}

Expand Down

0 comments on commit d9e6adc

Please sign in to comment.