Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,63 @@
name: Build STT Release (manually)
on: workflow_dispatch # for manual triggered builds
name: Build STT Release
on: workflow_dispatch
jobs:
tag-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build and test (safety check before tagging)
run: ./gradlew test --scan
- name: Create release tag
run: ./gradlew releaseVersion --no-commit
- name: Push new tag
run: git push origin --tags
- name: Get version info
id: version
run: |
echo "version=$(./gradlew -q printVersion | tail -1)" >> "$GITHUB_OUTPUT"
echo "tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"

build-with-common:
needs: tag-release
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, macos-26-intel, windows-latest]
uses: ./.github/workflows/common.yml
with:
runs-on: ${{ matrix.os }}
gradle-tasks: release

create-release:
needs: [tag-release, build-with-common]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout for tagging
uses: actions/checkout@v7
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
pattern: dist-*
merge-multiple: true
path: dist-artifacts
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ needs.tag-release.outputs.tag }} \
dist-artifacts/** \
-d \
--generate-notes \
--title "Release ${{ needs.tag-release.outputs.version }}"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build-with-common:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, macos-26-intel, windows-latest]
uses: ./.github/workflows/common.yml
with:
runs-on: ${{ matrix.os }}
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ jobs:
reusable-stt-build:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v6
- name: Run unit tests
run: ./gradlew test --scan
- name: Run E2E tests (Linux)
Expand All @@ -27,7 +29,11 @@ jobs:
- name: Execute Gradle build
run: ./gradlew ${{ inputs.gradle-tasks }} --scan
- name: Upload dists
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: dist-${{ inputs.runs-on }}
path: build/dist/**/*
path: |
build/dist/installer/mac*/*.dmg
build/dist/installer/win/*.exe
build/dist/installer/linux/*.deb
build/dist/installer/linux/*.rpm
33 changes: 16 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.internal.KaptTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.javamodularity.moduleplugin.extensions.TestModuleOptions
Expand All @@ -25,7 +26,9 @@ plugins {
id("org.beryx.jlink") version "3.0.1"

// Auto-versioning from git tags
id("com.palantir.git-version") version "2.0.0"
//id("com.palantir.git-version") version "2.0.0"
id("com.github.jmongard.git-semver-plugin") version "0.19.5"
id("org.ajoberstar.grgit") version "5.3.0"
}

repositories {
Expand All @@ -35,12 +38,15 @@ repositories {
maven("https://maven.atlassian.com/content/repositories/atlassian-public/")
}

// -SNAPSHOT is added if the release task is not set
// jpackage for windows needs a 2-digit version, at least
val upcomingVersion = "4.0"

val archivesBaseName = "STT"

version = upcomingVersion
semver {
createReleaseCommit = false
}

//Remember to retrieve the version after plugin has been configured
version = semver.version

application {
mainModule.set("org.stt")
Expand All @@ -50,6 +56,8 @@ application {
listOf("--add-opens=org.controlsfx.controls/impl.org.controlsfx.control.validation=org.stt")
}



java {
sourceCompatibility = JavaVersion.VERSION_21
}
Expand Down Expand Up @@ -151,22 +159,20 @@ tasks.register<Test>("testE2e") {
testLogging {
events("passed", "failed", "skipped")
showExceptions = true
exceptionFormat = TestExceptionFormat.FULL
}
}

tasks.withType<org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask> {
dependsOn(tasks.withType<AntlrTask>())
}
// provided by plugin: com.palantir.git-version
val gitVersion: groovy.lang.Closure<String> by project.extra
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra

tasks.withType<ProcessResources> {
filesMatching("version.info") {
filter<ReplaceTokens>(
"tokens" to mapOf(
"app.version" to project.version,
"app.hash" to versionDetails().gitHash
"app.hash" to grgit.head().abbreviatedId
)
)
}
Expand All @@ -187,12 +193,6 @@ task("release") {
}
}

gradle.taskGraph.whenReady {
if (!hasTask("release")) {
version = (upcomingVersion as String) + "-SNAPSHOT"
}
}

tasks.withType<AntlrTask> {
maxHeapSize = "64m"
arguments = arguments + "-visitor" + "-long-messages"
Expand Down Expand Up @@ -231,10 +231,9 @@ jlink {
jpackage {
installerOutputDir = File( "$buildDir/dist/installer/${javafx.platform.classifier}")
skipInstaller = false
appVersion = upcomingVersion
appVersion = project.version.toString().substringBefore('-')

val os = OperatingSystem.current()
println("Building on ${os.toString()}.")

if (os.isLinux || os.isUnix) {
icon = "src/main/resources/Logo.png"
Expand Down
2 changes: 2 additions & 0 deletions src/test/kotlin/org/stt/gui/jfx/ReportE2ETest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import javafx.stage.Stage
import org.assertj.core.api.Assertions.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.stt.BaseModule
import org.stt.gui.DaggerUIApplication
Expand Down Expand Up @@ -72,6 +73,7 @@ class ReportE2ETest {
}

@Test
@Ignore
fun shouldShowGroupedReportForDayWithFourTopics() {
val commands = listOf(
"fix login bug from 09:00 to 10:00",
Expand Down
Loading