generated from Anvil-Dev/ArchitecturyExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Anvil-Dev/releases/1.20.1
🐛 删除println
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 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,67 @@ | ||
name: CI for Mod | ||
on: | ||
push: | ||
branches: | ||
- dev/** | ||
paths: | ||
- src/** | ||
- build.gradle | ||
- gradle.properties | ||
- settings.gradle | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_BUILD: true | ||
PR_BUILD: false | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: validate gradle wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Read Properties | ||
id: 'properties' | ||
uses: christian-draeger/read-properties@1.1.1 | ||
with: | ||
path: gradle.properties | ||
properties: 'mod_id mod_name java_version' | ||
|
||
- name: Setup Java ${{ steps.properties.outputs.java_version }} | ||
uses: actions/setup-java@v3.6.0 | ||
with: | ||
distribution: zulu | ||
java-version: ${{ steps.properties.outputs.java_version }} | ||
|
||
- name: make gradle wrapper executable | ||
if: ${{ runner.os != 'Windows' }} | ||
run: chmod +x ./gradlew | ||
|
||
- name: Build with Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Build | ||
run: ./gradlew build | ||
|
||
- name: Find correct JAR | ||
id: find-jar | ||
run: | | ||
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")" | ||
echo "jarname=$output" >> $GITHUB_OUTPUT | ||
- name: capture build artifacts | ||
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} | ||
uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: ${{ steps.find-jar.outputs.jarname }} | ||
path: build/libs/${{ steps.find-jar.outputs.jarname }} | ||
|
||
- name: Publish to maven | ||
run: ./gradlew publish | ||
env: | ||
MAVEN_URL: ${{ secrets.MAVEN_URL }} | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASS }} | ||
continue-on-error: true |