FastAsyncWorldEdit/.github/workflows/build.yml

48 Zeilen
2.0 KiB
YAML

2020-11-23 18:49:08 +01:00
name: "build"
on: ["pull_request", "push"]
2020-11-23 18:49:08 +01:00
jobs:
build:
2021-10-08 19:03:41 +02:00
runs-on: "ubuntu-latest"
2020-11-23 18:49:08 +01:00
steps:
- name: "Checkout Repository"
uses: "actions/checkout@v2.4.0"
2021-10-08 19:03:41 +02:00
- name : "Validate Gradle Wrapper"
uses : "gradle/wrapper-validation-action@v1.0.4"
- name: "Setup Java"
uses: "actions/setup-java@v2.3.1"
with:
2021-08-09 15:09:55 +02:00
distribution: "temurin"
cache: 'gradle'
2021-10-08 19:03:41 +02:00
java-version: "17"
- name: "Clean Build"
run: "./gradlew clean build --no-daemon"
- name: "Determine release status"
if: "${{ runner.os == 'Linux' }}"
run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: "Publish Release"
if: "${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}"
run: "./gradlew publishToSonatype closeSonatypeStagingRepository"
env:
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"
if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
run: "./gradlew publishToSonatype"
env:
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}"
- name: "Archive Artifacts"
uses: "actions/upload-artifact@v2.2.4"
2021-07-28 15:04:49 +02:00
with:
name: "FastAsyncWorldEdit-Bukkit-SNAPSHOT"
path: "worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-*.jar"