2023-01-15 23:33:13 +00:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2020-11-23 17:49:08 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2023-01-15 23:33:13 +00:00
|
|
|
if: github.repository_owner == 'IntellectualSites'
|
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
|
2023-10-01 10:00:08 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-03-06 12:51:53 +00:00
|
|
|
- name: Validate Gradle Wrapper
|
2023-04-07 13:12:55 +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 }}
|
2022-06-17 13:09:32 +00:00
|
|
|
- name: Publish core javadoc
|
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
2023-04-07 13:12:55 +00:00
|
|
|
uses: cpina/github-action-push-to-another-repository@main
|
2022-06-17 13:09:32 +00:00
|
|
|
env:
|
|
|
|
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
|
|
|
with:
|
|
|
|
source-directory: 'worldedit-core/build/docs/javadoc'
|
|
|
|
destination-github-username: 'IntellectualSites'
|
|
|
|
destination-repository-name: 'fastasyncworldedit-javadocs'
|
|
|
|
user-email: ${{ secrets.USER_EMAIL }}
|
|
|
|
target-branch: main
|
|
|
|
target-directory: worldedit-core
|
|
|
|
- name: Publish bukkit javadoc
|
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
2023-04-07 13:12:55 +00:00
|
|
|
uses: cpina/github-action-push-to-another-repository@main
|
2022-06-17 13:09:32 +00:00
|
|
|
env:
|
|
|
|
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
|
|
|
with:
|
|
|
|
source-directory: 'worldedit-bukkit/build/docs/javadoc'
|
|
|
|
destination-github-username: 'IntellectualSites'
|
|
|
|
destination-repository-name: 'fastasyncworldedit-javadocs'
|
|
|
|
user-email: ${{ secrets.USER_EMAIL }}
|
|
|
|
target-branch: main
|
|
|
|
target-directory: worldedit-bukkit
|
2021-12-20 21:12:04 +00:00
|
|
|
- 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
|
2022-10-02 19:50:16 +00:00
|
|
|
- name: Publish to Modrinth
|
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
|
|
|
run: ./gradlew modrinth
|
|
|
|
env:
|
|
|
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|