From c369b421313deb4f653f63815d0fd30c50a30f65 Mon Sep 17 00:00:00 2001 From: rafael Date: Sat, 25 Apr 2026 19:32:53 -0400 Subject: [PATCH 1/2] ci: update release workflow to derive version from tag and update pom version to 1.0.0-SNAPSHOT --- .github/workflows/release.yml | 7 +++---- pom.xml | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e857aaf..b9666f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,10 @@ jobs: gpg-private-key: ${{ secrets.CODESIGN_PGP_KEY }} gpg-passphrase: PASSPHRASE - - name: Strip snapshot from version + - name: Set version from tag run: | - mvn -q build-helper:parse-version versions:set \ - -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} \ - versions:commit + VERSION="${GITHUB_REF_NAME#v}" + mvn -q versions:set -DnewVersion="$VERSION" versions:commit - name: Publish to Maven Central run: mvn deploy --batch-mode -DskipTests --activate-profiles central --no-transfer-progress diff --git a/pom.xml b/pom.xml index 567fb17..f4850ac 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.scanii scanii-java - 8.0.0-SNAPSHOT + 1.0.0-SNAPSHOT jar Scanii.com Java SDK scanii-java @@ -18,8 +18,7 @@ UTF-8 UTF-8 - 21 - 21 + 21 From 0cdffe5566bcd12f1f390eac715e4e6b1df1799b Mon Sep 17 00:00:00 2001 From: rafael Date: Sun, 26 Apr 2026 08:53:57 -0400 Subject: [PATCH 2/2] ci: simplify scanii-cli setup in pr.yml by using scanii/setup-cli-action --- .github/workflows/pr.yml | 53 ++-------------------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b5ff4c8..4118173 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -23,56 +23,7 @@ jobs: java-version: ${{ matrix.jdk }} distribution: corretto cache: maven - - name: Download scanii-cli - shell: bash - run: | - set -euo pipefail - # Resolve latest version - VERSION=$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" \ - https://api.github.com/repos/scanii/scanii-cli/releases/latest \ - | grep '"tag_name":' | sed -E 's/.*"v?([^"]+)".*/\1/') - echo "scanii-cli version: $VERSION" - - # Map runner to GoReleaser's OS/arch naming - case "${{ runner.os }}" in - Linux) OS=linux ; EXT=tar.gz ;; - macOS) OS=darwin ; EXT=tar.gz ;; - Windows) OS=windows; EXT=zip ;; - esac - case "$(uname -m)" in - x86_64|amd64) ARCH=amd64 ;; - arm64|aarch64) ARCH=arm64 ;; - *) ARCH=amd64 ;; - esac - - ASSET="scanii-cli-${VERSION}-${OS}-${ARCH}.${EXT}" - URL="https://github.com/scanii/scanii-cli/releases/download/v${VERSION}/${ASSET}" - echo "downloading $URL" - curl -fsSL "$URL" -o "$ASSET" - - # Unpack - if [ "$EXT" = "tar.gz" ]; then - tar -xzf "$ASSET" - else - unzip -q "$ASSET" - fi - - # Binary is inside a subdirectory due to wrap_in_directory: true - BINEXT="" - [ "$OS" = "windows" ] && BINEXT=".exe" - cp "scanii-cli-${VERSION}-${OS}-${ARCH}/sc${BINEXT}" "./sc${BINEXT}" - chmod +x ./sc 2>/dev/null || true - - - name: Start scanii-cli server - shell: bash - run: | - EXT="" - [ "${{ runner.os }}" = "Windows" ] && EXT=".exe" - ./sc${EXT} server & - # wait for the server to be ready - for i in $(seq 1 15); do - curl -sf http://localhost:4000/v2.2/ping && break || sleep 1 - done - + - name: Setup scanii-cli + uses: scanii/setup-cli-action@v1 - name: mvn verify run: mvn -B verify