forked from snowleopard1863/Ap-Turrets
-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
3ec607b
commit a52da21
Showing
2 changed files
with
54 additions
and
62 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,72 +1,58 @@ | ||
name: Java CI | ||
name: Gradle CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
release: | ||
types: [created, prereleased] | ||
|
||
jobs: | ||
# Build AP-Turrets | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout AP-Turrets | ||
uses: actions/checkout@v4 | ||
with: | ||
path: AP-Turrets | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
- name: Checkout Movecraft-Combat | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'APDevTeam/Movecraft-Combat' | ||
path: Movecraft-Combat | ||
ref: 'main' | ||
- name: Checkout Movecraft-WorldGuard | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'APDevTeam/Movecraft-WorldGuard' | ||
path: Movecraft-WorldGuard | ||
ref: 'main' | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
- name: Cache Maven packages | ||
id: cacheMain | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2 | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
# Build Movecraft-Combat | ||
- name: Build Movecraft-Combat | ||
run: mvn -B package -T 1C --file Movecraft-Combat/pom.xml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build with Gradle | ||
run: ./gradlew clean reobfJar --parallel | ||
|
||
# Build Movecraft-WorldGuard | ||
- name: Build Movecraft-WorldGuard | ||
run: mvn -B package -T 1C --file Movecraft-WorldGuard/pom.xml | ||
- name: Publish to GitHub Packages | ||
if: ${{ github.event_name == 'release' }} | ||
run: ./gradlew publish --parallel | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build AP-Turrets | ||
run: cd AP-Turrets && ./gradlew clean build | ||
|
||
- name: Stage jar | ||
run: mkdir staging && cp AP-Turrets/build/libs/AP-Turrets.jar staging && mv staging/AP-Turrets.jar staging/AP-Turrets_$GITHUB_SHA.jar | ||
- name: Upload jar | ||
- name: Stage jar for Actions | ||
if: ${{ github.event_name != 'release' }} | ||
run: mkdir staging && cp build/libs/AP-Turrets.jar staging && mv staging/AP-Turrets.jar staging/AP-Turrets_$GITHUB_SHA.jar | ||
- name: Upload jar to Actions | ||
if: ${{ github.event_name != 'release' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: AP-Turrets_Dev-Build | ||
path: staging/AP-Turrets_*.jar | ||
|
||
- name: Stage jar for Release | ||
if: ${{ github.event_name == 'release' }} | ||
run: mkdir staging && cp build/libs/AP-Turrets.jar staging && mv staging/AP-Turrets.jar staging/AP-Turrets_${{ github.event.release.tag_name }}.jar | ||
- name: Upload jar to Release | ||
if: ${{ github.event_name == 'release' }} | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: staging/AP-Turrets_${{ github.event.release.tag_name }}.jar |
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