-
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.
- Loading branch information
Showing
3 changed files
with
59 additions
and
67 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 |
---|---|---|
@@ -1,76 +1,30 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
compile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
cache: maven | ||
- name: Run Maven | ||
run: mvn -B -P dev compile | ||
- name: Upload Maven repo | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: compiled-repo | ||
path: ${{ github.workspace }} | ||
|
||
test: | ||
needs: compile | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
runs-on: ${{ matrix.os }} | ||
name: Run tests on ${{ matrix.os }} | ||
steps: | ||
- name: Download Maven repo | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: compiled-repo | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
cache: maven | ||
- if: runner.os == 'Linux' | ||
run: mvn -B -P dev test | ||
- if: runner.os != 'Linux' | ||
run: mvn -B -P unsupported-platform-test test | ||
|
||
publish: | ||
needs: test | ||
snapshot-deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Download Maven repo | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: compiled-repo | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
distribution: oracle | ||
java-version: | | ||
8 | ||
22 | ||
cache: maven | ||
- name: Deploy to GitHub Packages | ||
run: mvn -B -P dev deploy | ||
- name: Run Maven with Java 8 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Remove stale packages | ||
uses: actions/delete-package-versions@v4 | ||
with: | ||
package-name: com.yasuenag.hwrand | ||
package-type: maven | ||
min-versions-to-keep: 1 | ||
delete-only-pre-release-versions: "true" | ||
JAVA_HOME: ${{ env.JAVA_HOME_8_x64 }} | ||
run: mvn -B compile test | ||
- name: Run Maven with Java 22 | ||
env: | ||
JAVA_HOME: ${{ env.JAVA_HOME_22_x64 }} | ||
run: mvn -B package |
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,31 @@ | ||
name: Deploy snapshot library | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
snapshot-deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: oracle | ||
java-version: | | ||
8 | ||
22 | ||
cache: maven | ||
- name: Run Maven with Java 8 | ||
env: | ||
JAVA_HOME: ${{ env.JAVA_HOME_8_x64 }} | ||
run: mvn -B -DskipTests compile | ||
- name: Run Maven with Java 22 | ||
env: | ||
JAVA_HOME: ${{ env.JAVA_HOME_22_x64 }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: mvn -B -DskipTests deploy |
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