-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflows] separated workflows for push and prerelease/release
- Loading branch information
1 parent
b7e1800
commit a0cee2c
Showing
3 changed files
with
47 additions
and
22 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,39 @@ | ||
name: Build and test code source | ||
|
||
env: | ||
CI: true | ||
|
||
on: | ||
push: | ||
branches: [ "**" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
checks: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/[email protected] | ||
|
||
- name: Compile & Test | ||
run: ./gradlew test | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
files: '**/test-results/**/*.xml' |
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,23 +1,18 @@ | ||
name: Java CI with Gradle | ||
name: Publish artifacts into Maven Central | ||
|
||
env: | ||
CI: true | ||
|
||
on: | ||
push: | ||
branches: [ "**" ] | ||
release: | ||
types: [ created ] | ||
types: [ prereleased, released ] | ||
|
||
jobs: | ||
build: | ||
publish: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
checks: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -32,23 +27,13 @@ jobs: | |
- name: Setup Gradle | ||
uses: gradle/actions/[email protected] | ||
|
||
- name: Compile & Test | ||
run: ./gradlew test | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
files: '**/test-results/**/*.xml' | ||
|
||
- name: Generate package | ||
if: startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/') | ||
run: ./gradlew publish | ||
|
||
- name: Deploy released package in MavenCentral | ||
if: startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/') | ||
run: ./gradlew jreleaserDeploy | ||
env: | ||
DRY_RUN: ${{ github.event.release.prerelease }} | ||
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }} | ||
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }} | ||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GNUPG_PASSPHRASE }} | ||
|
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