From 989c70d741cc8d817c27f0f314d722df2bf62fbe Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Tue, 17 Dec 2024 02:46:59 +0100 Subject: [PATCH] versioning --- .github/workflows/build-gradle.yml | 18 +++++++----------- build.gradle.kts | 10 +++++++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-gradle.yml b/.github/workflows/build-gradle.yml index 9fb5c16c5..89811621a 100644 --- a/.github/workflows/build-gradle.yml +++ b/.github/workflows/build-gradle.yml @@ -37,11 +37,6 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Checkout Examples Repository - uses: actions/checkout@v4 - with: - repository: processing/processing-examples - path: processing-examples - name: Install Java uses: actions/setup-java@v4 with: @@ -51,17 +46,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - name: Build with Gradle - run: ./gradlew packageDistributionForCurrentOS -Pversion=${{ github.sha }} + run: ./gradlew packageDistributionForCurrentOS - name: Add instructions + if: ${{ matrix.os_prefix == 'macos' }} run: | - echo "run `xattr -d com.apple.quarantine Processing-4.3.2.dmg` to remove the quarantine flag" > ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt + echo "run 'xattr -d com.apple.quarantine Processing-${version}.dmg' to remove the quarantine flag" > ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt - name: Add artifact uses: actions/upload-artifact@v4 with: name: processing-${{github.sha}}${{ matrix.os_prefix }}-${{ matrix.arch }} path: | - ./app/build/compose/binaries/main/dmg/*.dmg - ./app/build/compose/binaries/main/dmg/*.txt - ./app/build/compose/binaries/main/msi/*.msi - ./app/build/compose/binaries/main/deb/*.deb + ./app/build/compose/binaries/main/dmg/Processing-*.dmg + ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt + ./app/build/compose/binaries/main/msi/Processing-*.msi + ./app/build/compose/binaries/main/deb/Processing-*.deb retention-days: 1 diff --git a/build.gradle.kts b/build.gradle.kts index 7bf9aa17f..71b540e14 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,13 @@ group = "org.processing" -version = "4.3.2" + +// Grab the latest version from the GitHub API +val apiUrl = "https://api.github.com/repos/processing/processing4/releases" +val response = java.net.URL(apiUrl).readText() +val tagName = response.substringAfter("\"tag_name\":\"").substringBefore("\"") +val currentVersion = tagName.split("-").last() +version = currentVersion.split(".").let { parts -> + "${parts[0]}.${parts[1]}.${parts[2].toInt() + 1}" +} plugins { kotlin("jvm") version libs.versions.kotlin apply false