-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
346 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Setup & run Gradle | ||
|
||
description: Setup Java & Gradle & optionally run a Gradle command | ||
|
||
inputs: | ||
java: | ||
default: '21' | ||
description: Java version | ||
gradle-args: | ||
required: false | ||
description: Arguments to Gradle command (optional) | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Java ${{ inputs.java }} | ||
id: setup-java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ inputs.java }} | ||
distribution: temurin | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Make gradlew executable | ||
if: inputs.gradle-args != '' && (runner.os == 'linux' || runner.os == 'macOS') | ||
shell: bash | ||
run: chmod +x gradlew | ||
|
||
- name: Run Gradle command | ||
if: ${{ inputs.gradle-args }} != '' | ||
env: | ||
JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }} | ||
shell: bash | ||
run: ./gradlew ${{ inputs.gradle-args }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Build | ||
|
||
on: [ push, pull_request, workflow_dispatch ] | ||
|
||
env: | ||
BASE_JAVA: 11 | ||
|
||
jobs: | ||
tests: | ||
name: Test on ${{ matrix.os }} with Java ${{ matrix.java }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
java: [ 11, 21 ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Redis | ||
shell: bash | ||
# It seems there's no straightforward way to install a recent redis version on Windows, so | ||
# let's only consider macOS & Ubuntu for RedisStore tests. | ||
run: | | ||
if [[ "${{ matrix.os }}" == macos* ]] | ||
then | ||
brew install redis | ||
elif [[ "${{ matrix.os }}" == ubuntu* ]] | ||
then | ||
chmod +x install-redis-ubuntu.sh | ||
./install-redis-ubuntu.sh | ||
fi | ||
- name: Run tests | ||
uses: ./.github/actions/gradle | ||
if: "!startsWith(matrix.os, 'macos')" | ||
with: | ||
java: ${{ matrix.java }} | ||
gradle-args: check | ||
|
||
# Brotli is not currently supported on macOS so related tests are excluded there. | ||
- name: Run tests | ||
uses: ./.github/actions/gradle | ||
if: startsWith(matrix.os, 'macos') | ||
with: | ||
java: ${{ matrix.java }} | ||
gradle-args: check -x :methanol-brotli:test | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ${{ matrix.os }}-java-${{ matrix.java }}-test-results | ||
path: | | ||
**/build/test-results/ | ||
**/build/**/*.exec | ||
coverage: | ||
name: Upload coverage report | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download test results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ubuntu-latest-java-${{ env.BASE_JAVA }}-test-results | ||
|
||
- name: Generate coverage report | ||
uses: ./.github/actions/gradle | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
with: | ||
java: ${{ env.BASE_JAVA }} | ||
gradle-args: coveralls | ||
|
||
snapshot-release: | ||
name: Release snapshot | ||
if: | | ||
github.event_name == 'push' | ||
&& github.ref_name == github.event.repository.default_branch | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Publish snapshot release artifacts | ||
uses: ./github/actions/gradle | ||
env: | ||
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }} | ||
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||
with: | ||
java: ${{ env.BASE_JAVA }} | ||
gradle-args: publishToSonatype |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish site | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
env: | ||
BASE_JAVA: 11 | ||
|
||
jobs: | ||
publish-site: | ||
name: Publish site | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# MkDocs needs python to run. | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11.1 | ||
|
||
- name: Setup Gradle | ||
uses: ./.github/actions/gradle | ||
with: | ||
java: 21 # Javadoc generation needs Java >= 12. | ||
|
||
- name: Generate docs | ||
run: chmod +x ./generate-docs.sh && ./generate-docs.sh | ||
|
||
- name: Deploy site | ||
uses: JamesIves/github-pages-deploy-action@4.1.1 | ||
with: | ||
branch: gh-pages | ||
folder: site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
env: | ||
BASE_JAVA: 11 | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Publish release artifacts | ||
uses: ./github/actions/gradle | ||
env: | ||
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }} | ||
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||
with: | ||
java: ${{ env.BASE_JAVA }} | ||
gradle-args: publishToSonatype closeAndReleaseSonatypeStagingRepository -PfinalRelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
import extensions.Version | ||
|
||
plugins { | ||
id("conventions.aggregate-coverage") | ||
id("conventions.aggregate-javadoc") | ||
id("conventions.aggregate-testing") | ||
alias(libs.plugins.nexus.publish) | ||
alias(libs.plugins.versions) | ||
} | ||
|
||
allprojects { | ||
description = "Lightweight HTTP extensions for Java" | ||
group = "com.github.mizosoft.methanol" | ||
version = "1.8.0-SNAPSHOT" | ||
version = Version( | ||
major = 1, | ||
minor = 8, | ||
patch = 0, | ||
release = if (project.hasProperty("finalRelease")) Version.Release.FINAL else Version.Release.SNAPSHOT | ||
) | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
this.repositories { | ||
repositories { | ||
sonatype { | ||
username.set(project.findProperty("nexusUsername")?.toString()) | ||
password.set(project.findProperty("nexusPassword")?.toString()) | ||
} | ||
} | ||
} | ||
|
||
//tasks.register("clean") { | ||
// delete(rootProject.buildDir) | ||
//} | ||
tasks.register("clean") { | ||
delete(rootProject.layout.buildDirectory) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.