Skip to content

Commit

Permalink
versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefterv committed Dec 17, 2024
1 parent b378022 commit 989c70d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 989c70d

Please sign in to comment.