2023-01-16 00:33:13 +01:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2020-11-23 18:49:08 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
2023-01-16 00:33:13 +01:00
|
|
|
if: github.repository_owner == 'IntellectualSites'
|
2021-12-20 22:12:04 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-23 18:49:08 +01:00
|
|
|
steps:
|
2021-12-20 22:12:04 +01:00
|
|
|
- name: Checkout Repository
|
2022-04-04 15:17:09 +02:00
|
|
|
uses: actions/checkout@v3
|
2023-03-06 13:51:53 +01:00
|
|
|
- name: Validate Gradle Wrapper
|
2023-04-07 15:12:55 +02:00
|
|
|
uses: gradle/wrapper-validation-action@v1
|
2021-12-20 22:12:04 +01:00
|
|
|
- name: Setup Java
|
2022-04-04 15:17:09 +02:00
|
|
|
uses: actions/setup-java@v3
|
2021-07-25 17:46:33 +02:00
|
|
|
with:
|
2021-12-20 22:12:04 +01: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 13:38:32 +01: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 22:12:04 +01:00
|
|
|
- name: Publish Release
|
2022-01-05 17:00:42 +01:00
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
2022-01-14 14:54:37 +01:00
|
|
|
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
|
2021-11-22 13:38:32 +01:00
|
|
|
env:
|
2021-12-20 22:12:04 +01: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 17:00:42 +01:00
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
2021-12-20 22:12:04 +01:00
|
|
|
run: ./gradlew publishToSonatype
|
2021-11-22 13:38:32 +01:00
|
|
|
env:
|
2021-12-20 22:12:04 +01:00
|
|
|
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
|
|
|
|
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
|
2022-06-17 15:09:32 +02:00
|
|
|
- name: Publish core javadoc
|
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
2023-04-07 15:12:55 +02:00
|
|
|
uses: cpina/github-action-push-to-another-repository@main
|
2022-06-17 15:09:32 +02: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 15:12:55 +02:00
|
|
|
uses: cpina/github-action-push-to-another-repository@main
|
2022-06-17 15:09:32 +02: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 22:12:04 +01:00
|
|
|
- name: Archive Artifacts
|
2022-04-04 15:17:09 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-07-28 15:04:49 +02:00
|
|
|
with:
|
2021-12-20 22:12:04 +01:00
|
|
|
name: FastAsyncWorldEdit-Bukkit-SNAPSHOT
|
|
|
|
path: worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-*.jar
|
2022-10-02 21:50:16 +02: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 }}
|
2023-03-06 13:51:53 +01:00
|
|
|
- name: Publish to CurseForge
|
|
|
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
|
2023-04-07 15:12:55 +02:00
|
|
|
uses: itsmeow/curseforge-upload@v3
|
2022-11-15 19:25:03 +01:00
|
|
|
with:
|
2023-03-07 00:14:47 +01:00
|
|
|
file_path: worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-${{ github.event.release.tag_name }}.jar
|
2022-11-15 19:25:03 +01:00
|
|
|
# https://minecraft.curseforge.com/api/game/versions?token=redacted
|
|
|
|
# gameVersionTypeID: 1
|
2022-12-11 18:36:13 +01:00
|
|
|
game_versions: "8503,9016,9190,9261,9560,9561"
|
2022-11-15 19:25:03 +01:00
|
|
|
project_id: 103525
|
|
|
|
game_endpoint: minecraft
|
|
|
|
token: ${{ secrets.CURSEFORGE_TOKEN }}
|
2023-03-07 00:14:47 +01:00
|
|
|
display_name: FastAsyncWorldEdit ${{ github.event.release.tag_name }}
|
2022-11-15 19:25:03 +01:00
|
|
|
release_type: release
|
|
|
|
changelog: "Click here to view changelog: https://github.com/IntellectualSites/FastAsyncWorldEdit/releases/tag/${{ github.event.release.tag_name }}"
|
|
|
|
changelog_type: markdown
|