2021-12-20 21:12:04 +00:00
|
|
|
name: build
|
2020-11-23 17:49:08 +00:00
|
|
|
|
2021-12-20 21:12:04 +00:00
|
|
|
on: [pull_request, push]
|
2021-07-25 15:46:33 +00:00
|
|
|
|
2020-11-23 17:49:08 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-01-07 09:42:57 +00:00
|
|
|
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
2021-12-20 21:12:04 +00:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-23 17:49:08 +00:00
|
|
|
steps:
|
2021-12-20 21:12:04 +00:00
|
|
|
- name: Checkout Repository
|
2022-04-04 13:17:09 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-12-20 21:12:04 +00:00
|
|
|
- name : Validate Gradle Wrapper
|
2022-04-04 13:17:09 +00:00
|
|
|
uses : gradle/wrapper-validation-action@v1
|
2021-12-20 21:12:04 +00:00
|
|
|
- name: Setup Java
|
2022-04-04 13:17:09 +00:00
|
|
|
uses: actions/setup-java@v3
|
2021-07-25 15:46:33 +00:00
|
|
|
with:
|
2021-12-20 21:12:04 +00:00
|
|
|
distribution: temurin
|
|
|
|
cache: gradle
|
|
|
|
java-version: 17
|
|
|
|
- name: Clean Build
|
|
|
|
run: ./gradlew clean build --no-daemon
|
|
|
|
- name: Determine release status
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
2021-11-22 12:38:32 +00:00
|
|
|
run: |
|
|
|
|
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
|
|
|
|
echo "STATUS=snapshot" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "STATUS=release" >> $GITHUB_ENV
|
|
|
|
fi
|
2021-12-20 21:12:04 +00:00
|
|
|
- name: Publish Release
|
2022-01-05 16:00:42 +00:00
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
2022-01-14 13:54:37 +00:00
|
|
|
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
|
2021-11-22 12:38:32 +00:00
|
|
|
env:
|
2021-12-20 21:12:04 +00:00
|
|
|
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
|
|
|
|
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
|
|
|
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
|
|
|
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
|
|
|
|
- name: Publish Snapshot
|
2022-01-05 16:00:42 +00:00
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
2021-12-20 21:12:04 +00:00
|
|
|
run: ./gradlew publishToSonatype
|
2021-11-22 12:38:32 +00:00
|
|
|
env:
|
2021-12-20 21:12:04 +00:00
|
|
|
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
|
|
|
|
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
|
|
|
|
- name: Archive Artifacts
|
2022-04-04 13:17:09 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-07-28 13:04:49 +00:00
|
|
|
with:
|
2021-12-20 21:12:04 +00:00
|
|
|
name: FastAsyncWorldEdit-Bukkit-SNAPSHOT
|
|
|
|
path: worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-*.jar
|