Merge pull request #163 from Bi2Nb9O3-Studio/releases/1.20.1 #250
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
on: | |
pull_request: | |
paths: | |
- src/** | |
- build.gradle | |
- gradle.properties | |
- settings.gradle | |
push: | |
branches: | |
- releases/** | |
paths: | |
- src/** | |
- build.gradle | |
- gradle.properties | |
- settings.gradle | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java: [ 17 ] | |
os: [ ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout | |
uses: actions/[email protected] | |
- name: validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: setup java ${{ matrix.java }} | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
- name: Setup cache | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
- name: make gradle wrapper executable | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: Set build number | |
run: sed -i "s/undefined/$GITHUB_RUN_NUMBER/g" gradle.properties | |
- 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/[email protected] | |
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_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |