Skip to content
Merged
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
53 changes: 2 additions & 51 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.scanii</groupId>
<artifactId>scanii-java</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Scanii.com Java SDK</description>
<name>scanii-java</name>
Expand All @@ -18,8 +18,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
</properties>

<licenses>
Expand Down
Loading