From 93cec2b0aaaa073c7cb9a4f8b9292557d6f06bb4 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 11:50:46 -0700 Subject: [PATCH 01/19] begin release workflow --- build.gradle | 1 - gradle.properties | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5471dde..9bb9b34 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,6 @@ plugins { } group = 'com.uber' -version = '4.1.3-SNAPSHOT' description = 'Java bindings for H3, a hierarchical hexagonal geospatial indexing system.' java { diff --git a/gradle.properties b/gradle.properties index 3686b79..41d8fc6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,5 @@ # Blocked on https://github.com/nbaztec/coveralls-jacoco-gradle-plugin/issues/66 org.gradle.configuration-cache=false +version=4.1.3-SNAPSHOT + From 4512fbf4b971aa1a8763a306ebb3b2d6fafa2c10 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 12:10:58 -0700 Subject: [PATCH 02/19] add release workflow file --- .github/workflows/release.yml | 210 ++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..297a174 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,210 @@ +name: Release to Maven Central + +on: + # Manual trigger + workflow_dispatch: + inputs: + release_version: + description: 'Version to release (if empty, derive from project version)' + required: false + # Automatic trigger on pushing a version tag (e.g., "v1.2.3") + push: + tags: + - 'v*' + # For testing: + pull_request: + branches: + - master + +jobs: + tests: + name: Java ${{ matrix.java-version }} ${{ matrix.os }} ${{ matrix.dockcross-only }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + java-distribution: [adopt] + java-version: [8] + dockcross-only: ["android-arm", "android-arm64", "linux-arm64", "linux-armv5", "linux-armv7", "linux-s390x", "linux-ppc64le", "linux-x64", "linux-x86", "windows-static-x64", "windows-static-x86"] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/setup-java@v2 + with: + distribution: "${{ matrix.java-distribution }}" + java-version: "${{ matrix.java-version }}" + + - uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: wrapper + + - uses: actions/cache@v4 + id: gradle-cache + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + # - name: Format check + # if: ${{ matrix.java-version != 8 }} + # run: ./gradlew spotlessCheck + + - name: Tests + run: ./gradlew clean test -Ph3SystemPrune=true "-Ph3DockcrossOnly=${{ matrix.dockcross-only }}" + env: + OCI_EXE: docker + + - name: Format check for C + run: git diff --exit-code + + - uses: actions/upload-artifact@v4 + name: Upload artifacts + if: ${{ matrix.java-version == 8 }} + with: + name: docker-built-shared-objects-${{ matrix.dockcross-only }} + path: | + src/main/resources/*/*.so + src/main/resources/*/*.dll + if-no-files-found: error + + tests-no-docker: + name: Java (No Docker) ${{ matrix.java-version }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + # TODO: Docker on macos-latest running is not working + os: [macos-latest] + java-distribution: [adopt] + java-version: [8] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/setup-java@v2 + with: + distribution: "${{ matrix.java-distribution }}" + java-version: "${{ matrix.java-version }}" + + - uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: wrapper + + - uses: actions/cache@v4 + id: gradle-cache + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Tests + run: ./gradlew clean test + + - uses: actions/upload-artifact@v4 + name: Upload Mac OS Artifacts + if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }} + with: + name: macos-built-shared-objects + path: src/main/resources/*/*.dylib + if-no-files-found: error + + release: + runs-on: ubuntu-latest + permissions: + contents: write # allow pushing commits/tags + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '21' + + - name: Determine release version + id: vars + run: | + # Derive the release version (drop "-SNAPSHOT") from Gradle project or input + VERSION_INPUT="${{ github.event.inputs.release_version || '' }}" + if [ -n "$VERSION_INPUT" ]; then + RELEASE_VERSION="$VERSION_INPUT" + else + # Read version from build.gradle.kts or gradle.properties + RELEASE_VERSION=$(grep -E 'version\s*=' build.gradle.kts | sed -E 's/.*\"(.+)-SNAPSHOT\".*/\1/') + fi + echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + + - name: Remove -SNAPSHOT suffix (prepare release version) + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" build.gradle.kts gradle.properties || true + git config user.name "github-actions" + git config user.email "[email protected]" + git commit -am "chore: release $RELEASE_VERSION [skip ci]" + + # - name: Create Git tag for release + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" + # git push origin HEAD:main --follow-tags + + - name: Download Docker binaries + uses: actions/download-artifact@v4.1.7 + with: + pattern: docker-built-shared-objects-* + merge-multiple: true + path: src/main/resources/ + + - name: Download Mac binaries + uses: actions/download-artifact@v4.1.7 + with: + name: macos-built-shared-objects + path: src/main/resources/ + + - name: Download and test + run: | + ./gradlew clean test -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true + + # - name: Publish to Sonatype OSSRH (Maven Central) + # env: + # ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} + # ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} + # ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} + # OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + # OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + # OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} + # run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository + + # - name: Create GitHub Release (with changelog notes) + # # This uses an action to create a release on GitHub + # uses: softprops/action-gh-release@v1 + # with: + # tag_name: "v${{ env.RELEASE_VERSION }}" + # release_name: "${{ env.RELEASE_VERSION }}" + # body_path: CHANGELOG.md # assumes changelog contains latest release notes at top + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - name: Bump to next snapshot version + # run: | + # # Bump minor version (for example) and append -SNAPSHOT for continued development + # NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment + # NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" + # sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" build.gradle.kts gradle.properties || true + # git config user.name "github-actions" + # git config user.email "[email protected]" + # git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" + # git push origin HEAD:main From 0348fdb69967e4dcb6aca142e61cb54e629c2fe6 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 12:23:59 -0700 Subject: [PATCH 03/19] sequence --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 297a174..66aef66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,6 +124,11 @@ jobs: runs-on: ubuntu-latest permissions: contents: write # allow pushing commits/tags + + needs: + - tests + - tests-no-docker + steps: - name: Check out code uses: actions/checkout@v3 From d61c9ce3eb4516f5e2cc67aa26e29207a9cea1a8 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 12:28:06 -0700 Subject: [PATCH 04/19] debug output --- .github/workflows/release.yml | 20 ++++++++++++++------ build.gradle | 4 ++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66aef66..1a87bf5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,11 +160,11 @@ jobs: git config user.email "[email protected]" git commit -am "chore: release $RELEASE_VERSION [skip ci]" - # - name: Create Git tag for release - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" - # git push origin HEAD:main --follow-tags + - name: Create Git tag for release + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" + git push origin HEAD:main --follow-tags - name: Download Docker binaries uses: actions/download-artifact@v4.1.7 @@ -181,7 +181,15 @@ jobs: - name: Download and test run: | - ./gradlew clean test -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true + ./gradlew clean test assemble -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true + + - name: WIP test + run: | + ls -lh build/libs + for f in build/libs/*.jar; do + echo "File: $f" + unzip -l "$f" + done # - name: Publish to Sonatype OSSRH (Maven Central) # env: diff --git a/build.gradle b/build.gradle index 9bb9b34..9bd5a62 100644 --- a/build.gradle +++ b/build.gradle @@ -113,6 +113,10 @@ jar { duplicatesStrategy = DuplicatesStrategy.WARN } +sourcesJar { + dependsOn buildH3 +} + publishing { publications { mavenJava(MavenPublication) { From 1abbcc67139c1c06e9c7e6e14d9f56d4df4326b1 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 13:28:20 -0700 Subject: [PATCH 05/19] prettier, enable --- .github/workflows/release.yml | 233 ++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 110 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a87bf5..a191f6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,18 +5,19 @@ on: workflow_dispatch: inputs: release_version: - description: 'Version to release (if empty, derive from project version)' + description: "Version to release (if empty, derive from project version)" required: false # Automatic trigger on pushing a version tag (e.g., "v1.2.3") push: tags: - - 'v*' + - "v*" # For testing: - pull_request: - branches: - - master + # pull_request: + # branches: + # - master -jobs: +jobs: + # tests and tests-no-docker are from tests.yml and build the actual native libraries that will be used in the release. tests: name: Java ${{ matrix.java-version }} ${{ matrix.os }} ${{ matrix.dockcross-only }} runs-on: ${{ matrix.os }} @@ -26,7 +27,20 @@ jobs: os: [ubuntu-latest] java-distribution: [adopt] java-version: [8] - dockcross-only: ["android-arm", "android-arm64", "linux-arm64", "linux-armv5", "linux-armv7", "linux-s390x", "linux-ppc64le", "linux-x64", "linux-x86", "windows-static-x64", "windows-static-x86"] + dockcross-only: + [ + "android-arm", + "android-arm64", + "linux-arm64", + "linux-armv5", + "linux-armv7", + "linux-s390x", + "linux-ppc64le", + "linux-x64", + "linux-x86", + "windows-static-x64", + "windows-static-x86", + ] steps: - uses: actions/checkout@v4 @@ -72,7 +86,7 @@ jobs: path: | src/main/resources/*/*.so src/main/resources/*/*.dll - if-no-files-found: error + if-no-files-found: error tests-no-docker: name: Java (No Docker) ${{ matrix.java-version }} ${{ matrix.os }} @@ -80,7 +94,6 @@ jobs: strategy: matrix: - # TODO: Docker on macos-latest running is not working os: [macos-latest] java-distribution: [adopt] java-version: [8] @@ -118,106 +131,106 @@ jobs: with: name: macos-built-shared-objects path: src/main/resources/*/*.dylib - if-no-files-found: error + if-no-files-found: error release: - runs-on: ubuntu-latest - permissions: - contents: write # allow pushing commits/tags - - needs: - - tests - - tests-no-docker - - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '21' - - - name: Determine release version - id: vars - run: | - # Derive the release version (drop "-SNAPSHOT") from Gradle project or input - VERSION_INPUT="${{ github.event.inputs.release_version || '' }}" - if [ -n "$VERSION_INPUT" ]; then - RELEASE_VERSION="$VERSION_INPUT" - else - # Read version from build.gradle.kts or gradle.properties - RELEASE_VERSION=$(grep -E 'version\s*=' build.gradle.kts | sed -E 's/.*\"(.+)-SNAPSHOT\".*/\1/') - fi - echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV - - - name: Remove -SNAPSHOT suffix (prepare release version) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" build.gradle.kts gradle.properties || true - git config user.name "github-actions" - git config user.email "[email protected]" - git commit -am "chore: release $RELEASE_VERSION [skip ci]" - - - name: Create Git tag for release - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" - git push origin HEAD:main --follow-tags - - - name: Download Docker binaries - uses: actions/download-artifact@v4.1.7 - with: - pattern: docker-built-shared-objects-* - merge-multiple: true - path: src/main/resources/ - - - name: Download Mac binaries - uses: actions/download-artifact@v4.1.7 - with: - name: macos-built-shared-objects - path: src/main/resources/ - - - name: Download and test - run: | - ./gradlew clean test assemble -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true - - - name: WIP test - run: | - ls -lh build/libs - for f in build/libs/*.jar; do - echo "File: $f" - unzip -l "$f" - done - - # - name: Publish to Sonatype OSSRH (Maven Central) - # env: - # ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} - # ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} - # ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} - # OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - # OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - # OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} - # run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository - - # - name: Create GitHub Release (with changelog notes) - # # This uses an action to create a release on GitHub - # uses: softprops/action-gh-release@v1 - # with: - # tag_name: "v${{ env.RELEASE_VERSION }}" - # release_name: "${{ env.RELEASE_VERSION }}" - # body_path: CHANGELOG.md # assumes changelog contains latest release notes at top - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: Bump to next snapshot version - # run: | - # # Bump minor version (for example) and append -SNAPSHOT for continued development - # NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment - # NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" - # sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" build.gradle.kts gradle.properties || true - # git config user.name "github-actions" - # git config user.email "[email protected]" - # git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" - # git push origin HEAD:main + runs-on: ubuntu-latest + permissions: + contents: write # allow pushing commits/tags + + needs: + - tests + - tests-no-docker + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: "21" + + - name: Determine release version + id: vars + run: | + # Derive the release version (drop "-SNAPSHOT") from Gradle project or input + VERSION_INPUT="${{ github.event.inputs.release_version || '' }}" + if [ -n "$VERSION_INPUT" ]; then + RELEASE_VERSION="$VERSION_INPUT" + else + # Read version from build.gradle.kts or gradle.properties + RELEASE_VERSION=$(grep -E 'version\s*=' build.gradle.kts | sed -E 's/.*\"(.+)-SNAPSHOT\".*/\1/') + fi + echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + + - name: Remove -SNAPSHOT suffix (prepare release version) + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" build.gradle.kts gradle.properties || true + git config user.name "github-actions" + git config user.email "[email protected]" + git commit -am "chore: release $RELEASE_VERSION [skip ci]" + + - name: Create Git tag for release + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" + git push origin HEAD:main --follow-tags + + - name: Download Docker binaries + uses: actions/download-artifact@v4.1.7 + with: + pattern: docker-built-shared-objects-* + merge-multiple: true + path: src/main/resources/ + + - name: Download Mac binaries + uses: actions/download-artifact@v4.1.7 + with: + name: macos-built-shared-objects + path: src/main/resources/ + + - name: Download and test + run: | + ./gradlew clean test assemble -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true + + - name: List files in jars + run: | + ls -lh build/libs + for f in build/libs/*.jar; do + echo "File: $f" + unzip -l "$f" + done + + - name: Publish to Sonatype OSSRH (Maven Central) + env: + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} + run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository + + - name: Create GitHub Release (with changelog notes) + # This uses an action to create a release on GitHub + uses: softprops/action-gh-release@v1 + with: + tag_name: "v${{ env.RELEASE_VERSION }}" + release_name: "${{ env.RELEASE_VERSION }}" + body_path: CHANGELOG.md # assumes changelog contains latest release notes at top + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Bump to next snapshot version + run: | + # Bump minor version (for example) and append -SNAPSHOT for continued development + NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment + NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" + sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" build.gradle.kts gradle.properties || true + git config user.name "github-actions" + git config user.email "[email protected]" + git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" + git push origin HEAD:main From 67b1e6550e596e880ba598b20ba2163e94625a68 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 13:50:53 -0700 Subject: [PATCH 06/19] change per review --- .github/workflows/release.yml | 32 +++++++++++++------------------- .github/workflows/tests.yml | 13 ++++++++----- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a191f6b..dc35968 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,9 +17,9 @@ on: # - master jobs: - # tests and tests-no-docker are from tests.yml and build the actual native libraries that will be used in the release. - tests: - name: Java ${{ matrix.java-version }} ${{ matrix.os }} ${{ matrix.dockcross-only }} + # Corresponsd to tests in tests.yml + build-with-docker: + name: Build ${{ matrix.dockcross-only }} (Dockcross) runs-on: ${{ matrix.os }} strategy: @@ -66,21 +66,13 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - # - name: Format check - # if: ${{ matrix.java-version != 8 }} - # run: ./gradlew spotlessCheck - - name: Tests run: ./gradlew clean test -Ph3SystemPrune=true "-Ph3DockcrossOnly=${{ matrix.dockcross-only }}" env: OCI_EXE: docker - - name: Format check for C - run: git diff --exit-code - - uses: actions/upload-artifact@v4 name: Upload artifacts - if: ${{ matrix.java-version == 8 }} with: name: docker-built-shared-objects-${{ matrix.dockcross-only }} path: | @@ -88,13 +80,15 @@ jobs: src/main/resources/*/*.dll if-no-files-found: error - tests-no-docker: - name: Java (No Docker) ${{ matrix.java-version }} ${{ matrix.os }} + # Corresponsd to tests-no-docker in tests.yml + build: + name: Build ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest] + # macos-13 is for Intel Macs + os: [macos-latest, macos-13] java-distribution: [adopt] java-version: [8] @@ -127,9 +121,8 @@ jobs: - uses: actions/upload-artifact@v4 name: Upload Mac OS Artifacts - if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }} with: - name: macos-built-shared-objects + name: macos-built-shared-objects-${{ matrix.os }} path: src/main/resources/*/*.dylib if-no-files-found: error @@ -139,8 +132,8 @@ jobs: contents: write # allow pushing commits/tags needs: - - tests - - tests-no-docker + - build-with-docker + - build steps: - name: Check out code @@ -189,7 +182,8 @@ jobs: - name: Download Mac binaries uses: actions/download-artifact@v4.1.7 with: - name: macos-built-shared-objects + name: macos-built-shared-objects-* + merge-multiple: true path: src/main/resources/ - name: Download and test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb0ecee..3e9c6e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -114,9 +114,10 @@ jobs: strategy: matrix: + # macos-13 is for Intel Macs # TODO: Docker on macos-latest running is not working # TODO: Windows pinned back - os: [macos-latest, windows-2019] + os: [macos-latest, macos-13, windows-2019] java-distribution: [adopt] java-version: [8, 11, 17, 21, 22] @@ -149,9 +150,9 @@ jobs: - uses: actions/upload-artifact@v4 name: Upload Mac OS Artifacts - if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }} + if: ${{ (matrix.os == 'macos-latest' || matrix.os == 'macos-13') && matrix.java-version == 8 }} with: - name: macos-built-shared-objects + name: macos-built-shared-objects-${{ matrix.os }} path: src/main/resources/*/*.dylib if-no-files-found: error @@ -242,7 +243,8 @@ jobs: - name: Download Mac binaries uses: actions/download-artifact@v4.1.7 with: - name: macos-built-shared-objects + name: macos-built-shared-objects-* + merge-multiple: true path: src/main/resources/ - name: Download and test @@ -298,7 +300,8 @@ jobs: - name: Download Mac binaries uses: actions/download-artifact@v4.1.7 with: - name: macos-built-shared-objects + name: macos-built-shared-objects-* + merge-multiple: true path: src/main/resources/ - name: Download and test From 382d835396c1a65cdc8e07e76f6cfa9b8cdb8273 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 13:56:16 -0700 Subject: [PATCH 07/19] changelog --- .github/workflows/release.yml | 4 ---- CHANGELOG.md | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc35968..0a32d56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,6 @@ on: push: tags: - "v*" - # For testing: - # pull_request: - # branches: - # - master jobs: # Corresponsd to tests in tests.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 712db0b..ad33d55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,20 @@ file [H3Core.java](./src/main/java/com/uber/h3core/H3Core.java), and support for the Linux x64 and Darwin x64 platforms. ## Unreleased Changes +## Added +- `polygonToCellsExperimental` functions from H3 v4.2.0. (#163) + +## Fixed +- Corrected order of `polygonToCellsExperimental` arguments. (#166) +- Fixed build on ARM Linux. (#162) + +## Changed +- Converted build system to Gradle and automated deploys. Added separate build steps for mac OS on M1 (ARM) and x64. (#167, #168) +- Upgraded the core library to v4.2.1. (#165) ## [4.1.2] - 2024-11-01 +Note: This release is not available in Maven Central. + ## Fixed - Fixed a memory leak in `polygonToCells` and optimize JNI calls. (#150) - Use `Files.createTempFile` so temporary file permissions are more restrictive. (#141) From 3f27843a48d5b734de60a473f4d2156cc85977bc Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 29 May 2025 16:42:26 -0700 Subject: [PATCH 08/19] revert mac changes --- .github/workflows/release.yml | 8 +++----- .github/workflows/tests.yml | 13 +++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a32d56..7ece84a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,8 +83,7 @@ jobs: strategy: matrix: - # macos-13 is for Intel Macs - os: [macos-latest, macos-13] + os: [macos-latest] java-distribution: [adopt] java-version: [8] @@ -118,7 +117,7 @@ jobs: - uses: actions/upload-artifact@v4 name: Upload Mac OS Artifacts with: - name: macos-built-shared-objects-${{ matrix.os }} + name: macos-built-shared-objects path: src/main/resources/*/*.dylib if-no-files-found: error @@ -178,8 +177,7 @@ jobs: - name: Download Mac binaries uses: actions/download-artifact@v4.1.7 with: - name: macos-built-shared-objects-* - merge-multiple: true + name: macos-built-shared-objects path: src/main/resources/ - name: Download and test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e9c6e8..eb0ecee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -114,10 +114,9 @@ jobs: strategy: matrix: - # macos-13 is for Intel Macs # TODO: Docker on macos-latest running is not working # TODO: Windows pinned back - os: [macos-latest, macos-13, windows-2019] + os: [macos-latest, windows-2019] java-distribution: [adopt] java-version: [8, 11, 17, 21, 22] @@ -150,9 +149,9 @@ jobs: - uses: actions/upload-artifact@v4 name: Upload Mac OS Artifacts - if: ${{ (matrix.os == 'macos-latest' || matrix.os == 'macos-13') && matrix.java-version == 8 }} + if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }} with: - name: macos-built-shared-objects-${{ matrix.os }} + name: macos-built-shared-objects path: src/main/resources/*/*.dylib if-no-files-found: error @@ -243,8 +242,7 @@ jobs: - name: Download Mac binaries uses: actions/download-artifact@v4.1.7 with: - name: macos-built-shared-objects-* - merge-multiple: true + name: macos-built-shared-objects path: src/main/resources/ - name: Download and test @@ -300,8 +298,7 @@ jobs: - name: Download Mac binaries uses: actions/download-artifact@v4.1.7 with: - name: macos-built-shared-objects-* - merge-multiple: true + name: macos-built-shared-objects path: src/main/resources/ - name: Download and test From c3f9350c2377f58dead82b0d12e3947205449be2 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 4 Jun 2025 12:07:59 -0700 Subject: [PATCH 09/19] change per review --- .github/workflows/release.yml | 10 +++++----- docs/releasing.md | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ece84a..ee462b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ on: - "v*" jobs: - # Corresponsd to tests in tests.yml + # Corresponds to tests in tests.yml build-with-docker: name: Build ${{ matrix.dockcross-only }} (Dockcross) runs-on: ${{ matrix.os }} @@ -148,15 +148,14 @@ jobs: if [ -n "$VERSION_INPUT" ]; then RELEASE_VERSION="$VERSION_INPUT" else - # Read version from build.gradle.kts or gradle.properties - RELEASE_VERSION=$(grep -E 'version\s*=' build.gradle.kts | sed -E 's/.*\"(.+)-SNAPSHOT\".*/\1/') + RELEASE_VERSION=$(grep -E 'version\s*=' gradle.properties | sed -E 's/.*\"(.+)-SNAPSHOT\".*/\1/') fi echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV - name: Remove -SNAPSHOT suffix (prepare release version) if: ${{ github.event_name == 'workflow_dispatch' }} run: | - sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" build.gradle.kts gradle.properties || true + sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" gradle.properties || true git config user.name "github-actions" git config user.email "[email protected]" git commit -am "chore: release $RELEASE_VERSION [skip ci]" @@ -213,11 +212,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Bump to next snapshot version + if: ${{ github.event_name != 'workflow_dispatch' }} run: | # Bump minor version (for example) and append -SNAPSHOT for continued development NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" - sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" build.gradle.kts gradle.properties || true + sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" gradle.properties || true git config user.name "github-actions" git config user.email "[email protected]" git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" diff --git a/docs/releasing.md b/docs/releasing.md index 1f7013c..83b0a72 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -2,6 +2,10 @@ The H3-Java library is published to Maven Central via OSSRH. +The release is triggered via GitHub Actions, when a tag of the form `v1.2.3` is pushed, or via workflow dispatch. The release workflow handles all parts of the release. + +## Old instructions for manual releasing + You must be a member of the `com.uber` group to release the library via OSSRH. You must have a [signing key](http://central.sonatype.org/pages/working-with-pgp-signatures.html) setup, and you must have your OSSRH username and password in the appropriate [Maven settings file](http://central.sonatype.org/pages/apache-maven.html). Release builds pull artifacts from Github Actions. This is needed so that the deployed artifact contains all supported operating system/architecture combinations. (In particular, Mac OS artifacts must be built natively.) In order to release, there must be a completed build of the Git commit to release on Github. The build must be less than 30 days old, as artifacts are only kept for that time. @@ -13,14 +17,14 @@ Release builds pull artifacts from Github Actions. This is needed so that the de 5. If this looks good, close and release the build in [Sonatype Nexus Manager](https://oss.sonatype.org/). 6. Update `CHANGELOG.md` to have an Unreleased section, and commit. The release is now done and development can resume from this point. -## Troubleshooting +### Troubleshooting -### Dependencies for `pull-from-github.sh` +#### Dependencies for `pull-from-github.sh` * You should install the [Github CLI](https://cli.github.com) and authenticate with it first. You may need to use a personal access token (classic) with workflows scope. * `jq` -### gpg: signing failed: Inappropriate ioctl for device +#### gpg: signing failed: Inappropriate ioctl for device Per [StackOverflow](https://stackoverflow.com/questions/57591432/gpg-signing-failed-inappropriate-ioctl-for-device-on-macos-with-maven), run the following before `mvn release:perform`: From 4645e8a8d955d3ccb5b9a3aba7e204734ab1cf9d Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Tue, 17 Jun 2025 22:10:20 -0500 Subject: [PATCH 10/19] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad33d55..c0b3705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ for the Linux x64 and Darwin x64 platforms. ## Unreleased Changes ## Added - `polygonToCellsExperimental` functions from H3 v4.2.0. (#163) +- `gridRing` function from H3 v4.3.0. (#169) ## Fixed - Corrected order of `polygonToCellsExperimental` arguments. (#166) From 851ab91cc7e7f3b5ba57e28ae38468018cf4363a Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Mon, 23 Jun 2025 10:35:33 -0700 Subject: [PATCH 11/19] wip: release io.github.isaacbrodsky --- .github/workflows/release.yml | 3 ++- build.gradle | 20 +++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee462b3..7ff699b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -199,7 +199,8 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository + run: ./gradlew publishToSonatype + # closeAndReleaseSonatypeStagingRepository - name: Create GitHub Release (with changelog notes) # This uses an action to create a release on GitHub diff --git a/build.gradle b/build.gradle index 9bd5a62..3c38a90 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ plugins { id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' } -group = 'com.uber' +group = 'io.github.isaacbrodsky' description = 'Java bindings for H3, a hierarchical hexagonal geospatial indexing system.' java { @@ -123,7 +123,7 @@ publishing { from components.java pom { name = 'h3' - url = 'https://github.com/uber/h3-java' + url = 'https://github.com/isaacbrodsky/h3-java' description = project.description licenses { license { @@ -132,22 +132,20 @@ publishing { distribution = 'repo' } } - organization { - name = 'Uber Open Source' - url = 'https://github.com/uber/' - } + # organization { + # name = 'Uber Open Source' + # url = 'https://github.com/uber/' + # } scm { - connection = 'scm:git:git://github.com/uber/h3-java.git' - developerConnection = 'scm:git:ssh://git@github.com/uber/h3-java.git' - url = 'http://github.com/uber/h3-java/tree/master' + connection = 'scm:git:git://github.com/isaacbrodsky/h3-java.git' + developerConnection = 'scm:git:ssh://git@github.com/isaacbrodsky/h3-java.git' + url = 'http://github.com/isaacbrodsky/h3-java/tree/master' } developers { developer { id = 'isaacbrodsky' name = 'Isaac Brodsky' email = 'isaac@isaacbrodsky.com' - organization = 'Uber Technologies, Inc.' - organizationUrl = 'https://github.com/uber/' } } } From 41e97664e9e67c5a6634904cdb8f623212b81c79 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 16:05:50 +0200 Subject: [PATCH 12/19] test on this repo --- .github/workflows/release.yml | 51 ++++++++++++++++++----------------- build.gradle | 8 +++--- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ff699b..eeb8972 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,9 @@ on: push: tags: - "v*" + pull_request: + branches: + - master jobs: # Corresponds to tests in tests.yml @@ -152,19 +155,19 @@ jobs: fi echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV - - name: Remove -SNAPSHOT suffix (prepare release version) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" gradle.properties || true - git config user.name "github-actions" - git config user.email "[email protected]" - git commit -am "chore: release $RELEASE_VERSION [skip ci]" + # - name: Remove -SNAPSHOT suffix (prepare release version) + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" gradle.properties || true + # git config user.name "github-actions" + # git config user.email "[email protected]" + # git commit -am "chore: release $RELEASE_VERSION [skip ci]" - - name: Create Git tag for release - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" - git push origin HEAD:main --follow-tags + # - name: Create Git tag for release + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" + # git push origin HEAD:main --follow-tags - name: Download Docker binaries uses: actions/download-artifact@v4.1.7 @@ -199,7 +202,7 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} - run: ./gradlew publishToSonatype + run: ./gradlew publishToSonatype closeSonatypeStagingRepository # closeAndReleaseSonatypeStagingRepository - name: Create GitHub Release (with changelog notes) @@ -212,14 +215,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Bump to next snapshot version - if: ${{ github.event_name != 'workflow_dispatch' }} - run: | - # Bump minor version (for example) and append -SNAPSHOT for continued development - NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment - NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" - sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" gradle.properties || true - git config user.name "github-actions" - git config user.email "[email protected]" - git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" - git push origin HEAD:main + # - name: Bump to next snapshot version + # if: ${{ github.event_name != 'workflow_dispatch' }} + # run: | + # # Bump minor version (for example) and append -SNAPSHOT for continued development + # NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment + # NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" + # sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" gradle.properties || true + # git config user.name "github-actions" + # git config user.email "[email protected]" + # git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" + # git push origin HEAD:main diff --git a/build.gradle b/build.gradle index 3c38a90..22dd2f6 100644 --- a/build.gradle +++ b/build.gradle @@ -132,10 +132,10 @@ publishing { distribution = 'repo' } } - # organization { - # name = 'Uber Open Source' - # url = 'https://github.com/uber/' - # } + // organization { + // name = 'Uber Open Source' + // url = 'https://github.com/uber/' + // } scm { connection = 'scm:git:git://github.com/isaacbrodsky/h3-java.git' developerConnection = 'scm:git:ssh://git@github.com/isaacbrodsky/h3-java.git' From 4d241f97834cec6163eaf9b16de5343f86e7fcd8 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 16:23:32 +0200 Subject: [PATCH 13/19] fix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eeb8972..94874d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -202,7 +202,7 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} - run: ./gradlew publishToSonatype closeSonatypeStagingRepository + run: ./gradlew publishToSonatype closeSonatypeStagingRepository -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true # closeAndReleaseSonatypeStagingRepository - name: Create GitHub Release (with changelog notes) From 507bc6396ac91ed47217e383564e7488fc218cad Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 16:34:56 +0200 Subject: [PATCH 14/19] env name --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94874d3..811b8eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -196,9 +196,9 @@ jobs: - name: Publish to Sonatype OSSRH (Maven Central) env: - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} - ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} From 9ac95785040ebd12e7be3f2433ed29c790f261b4 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 16:50:50 +0200 Subject: [PATCH 15/19] fix url --- build.gradle | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 22dd2f6..3fd731b 100644 --- a/build.gradle +++ b/build.gradle @@ -178,12 +178,15 @@ signing { nexusPublishing { repositories { sonatype { - stagingProfileId.set(System.getenv("OSSRH_STAGING_PROFILE_ID")) + // Performance optimization, not needed: + // stagingProfileId.set(System.getenv("OSSRH_STAGING_PROFILE_ID")) username.set(System.getenv("OSSRH_USERNAME")) password.set(System.getenv("OSSRH_PASSWORD")) // For newer Sonatype accounts (after Feb 2021) use "s01.oss.sonatype.org": - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + // nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + // snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) } } } From 8fb90003e75de9e921bf8cc6c80b5bd553f01a45 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 17:13:16 +0200 Subject: [PATCH 16/19] no close --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 811b8eb..6a636db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -202,7 +202,7 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} - run: ./gradlew publishToSonatype closeSonatypeStagingRepository -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true + run: ./gradlew publishToSonatype -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true # closeAndReleaseSonatypeStagingRepository - name: Create GitHub Release (with changelog notes) From f6939fc821008e8df67775c22030d56f0f3935af Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 17:36:55 +0200 Subject: [PATCH 17/19] uncomment --- .github/workflows/release.yml | 53 +++++++++++++++++------------------ gradle.properties | 1 + 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a636db..4f026f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,23 +151,23 @@ jobs: if [ -n "$VERSION_INPUT" ]; then RELEASE_VERSION="$VERSION_INPUT" else - RELEASE_VERSION=$(grep -E 'version\s*=' gradle.properties | sed -E 's/.*\"(.+)-SNAPSHOT\".*/\1/') + RELEASE_VERSION=$(grep -E 'version=' gradle.properties | sed -E 's/version=//') fi echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV - # - name: Remove -SNAPSHOT suffix (prepare release version) - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" gradle.properties || true - # git config user.name "github-actions" - # git config user.email "[email protected]" - # git commit -am "chore: release $RELEASE_VERSION [skip ci]" + - name: Remove -SNAPSHOT suffix (prepare release version) + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + sed -i -E "s/${RELEASE_VERSION}-SNAPSHOT/$RELEASE_VERSION/" gradle.properties || true + git config user.name "github-actions" + git config user.email "[email protected]" + git commit -am "chore: release $RELEASE_VERSION [skip ci]" - # - name: Create Git tag for release - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" - # git push origin HEAD:main --follow-tags + - name: Create Git tag for release + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" + git push origin HEAD:main --follow-tags - name: Download Docker binaries uses: actions/download-artifact@v4.1.7 @@ -202,27 +202,26 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} - run: ./gradlew publishToSonatype -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true - # closeAndReleaseSonatypeStagingRepository + run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true - name: Create GitHub Release (with changelog notes) # This uses an action to create a release on GitHub uses: softprops/action-gh-release@v1 with: tag_name: "v${{ env.RELEASE_VERSION }}" - release_name: "${{ env.RELEASE_VERSION }}" + name: "${{ env.RELEASE_VERSION }}" body_path: CHANGELOG.md # assumes changelog contains latest release notes at top env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Bump to next snapshot version - # if: ${{ github.event_name != 'workflow_dispatch' }} - # run: | - # # Bump minor version (for example) and append -SNAPSHOT for continued development - # NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. '{$NF += 1; OFS="."; print $0}') # increment last segment - # NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" - # sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" gradle.properties || true - # git config user.name "github-actions" - # git config user.email "[email protected]" - # git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" - # git push origin HEAD:main + - name: Bump to next snapshot version + if: ${{ github.event_name != 'workflow_dispatch' }} + run: | + # Bump minor version (for example) and append -SNAPSHOT for continued development + NEXT_VERSION=$(echo $RELEASE_VERSION | awk -F. -v OFS="." '{$NF += 1; print $0}') # increment last segment + NEXT_VERSION="$NEXT_VERSION-SNAPSHOT" + sed -i -E "s/$RELEASE_VERSION/$NEXT_VERSION/" gradle.properties || true + git config user.name "github-actions" + git config user.email "[email protected]" + git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" + git push origin HEAD:main diff --git a/gradle.properties b/gradle.properties index 41d8fc6..52cf20b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,5 +4,6 @@ # Blocked on https://github.com/nbaztec/coveralls-jacoco-gradle-plugin/issues/66 org.gradle.configuration-cache=false +# No spaces on the following line, needed by release.tml version=4.1.3-SNAPSHOT From 01adf10f0366ec7c169221dc9e47d3e1a5837330 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 17:40:02 +0200 Subject: [PATCH 18/19] not on pr --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f026f8..2d57a4d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,6 @@ on: push: tags: - "v*" - pull_request: - branches: - - master jobs: # Corresponds to tests in tests.yml From 4d342447006b6c52fc469a2d6f6b22f35147e638 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Wed, 25 Jun 2025 18:14:52 +0200 Subject: [PATCH 19/19] release 4.3.0 from isaacbrodsky --- .github/workflows/release.yml | 4 ++-- gradle.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d57a4d..032bb3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -164,7 +164,7 @@ jobs: if: ${{ github.event_name == 'workflow_dispatch' }} run: | git tag -a "v${RELEASE_VERSION}" -m "Release $RELEASE_VERSION" - git push origin HEAD:main --follow-tags + git push origin HEAD:master --follow-tags - name: Download Docker binaries uses: actions/download-artifact@v4.1.7 @@ -221,4 +221,4 @@ jobs: git config user.name "github-actions" git config user.email "[email protected]" git commit -am "chore: start next development cycle $NEXT_VERSION [skip ci]" - git push origin HEAD:main + git push origin HEAD:master diff --git a/gradle.properties b/gradle.properties index 52cf20b..d1188b4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,5 +5,5 @@ org.gradle.configuration-cache=false # No spaces on the following line, needed by release.tml -version=4.1.3-SNAPSHOT +version=4.3.0