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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
java: [8, 11, 17, 21]
# 17 is the minimum; 21 and 25 are the current LTS releases.
java: [17, 21, 25]

steps:
- name: Checkout code
Expand All @@ -34,12 +35,11 @@ jobs:
run: chmod +x gradlew
if: runner.os != 'Windows'

- name: Build with Gradle
# build runs the tests, javadoc and checkGeneratedTypes. The SDK generator is
# private, so CI only verifies the headers of src/main/java/co/lettermint/types.
- name: Build and test
run: ./gradlew build --no-daemon

- name: Run tests
run: ./gradlew test --no-daemon

- name: Upload test results
uses: actions/upload-artifact@v7
if: failure()
Expand Down Expand Up @@ -71,7 +71,6 @@ jobs:

- name: Check build output
run: |
if [ ! -d "build/libs" ]; then
echo "Build output directory 'build/libs' not found"
exit 1
fi
jar=$(ls build/libs/lettermint-*.jar | grep -v -e sources -e javadoc)
unzip -p "$jar" META-INF/MANIFEST.MF | grep -q 'Automatic-Module-Name: co.lettermint'
if unzip -l "$jar" | grep -q okhttp; then echo "okhttp must not be bundled"; exit 1; fi
16 changes: 11 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17, 21]
java: [17, 21, 25]

steps:
- name: Checkout code
Expand All @@ -36,7 +36,7 @@ jobs:
run: chmod +x gradlew

- name: Run tests
run: ./gradlew test --no-daemon
run: ./gradlew build --no-daemon

release:
name: Release
Expand Down Expand Up @@ -71,8 +71,14 @@ jobs:
fi

echo "RELEASE_VERSION=$version" >> "$GITHUB_ENV"
perl -0pi -e "s/^version = '.*'$/version = '$version'/m" build.gradle
RELEASE_VERSION="$version" perl -0pi -e 's|(<artifactId>lettermint</artifactId>\s*<version>)[^<]+(</version>)|$1$ENV{RELEASE_VERSION}$2|' pom.xml

# build.gradle reads the version from -PreleaseVersion; check the jar before publishing.
- name: Build and check the release version
run: |
./gradlew build -PreleaseVersion="$RELEASE_VERSION" --no-daemon
jar="build/libs/lettermint-$RELEASE_VERSION.jar"
unzip -p "$jar" META-INF/MANIFEST.MF | grep -q "Implementation-Version: $RELEASE_VERSION"
unzip -p "$jar" co/lettermint/BuildInfo.class | grep -q "$RELEASE_VERSION"

- name: Publish to Maven Central
env:
Expand All @@ -83,7 +89,7 @@ jobs:
GPG_PRIVATE_KEY_BASE64: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
export ORG_GRADLE_PROJECT_signingKey=$(echo "$GPG_PRIVATE_KEY_BASE64" | base64 -d)
./gradlew publish --no-daemon
./gradlew publish -PreleaseVersion="$RELEASE_VERSION" --no-daemon

- name: Release staging repository
env:
Expand Down
Loading
Loading