2021-05-01 22:37:24 +02:00
|
|
|
name: Build EssentialsX
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 2.x
|
2021-12-15 21:20:06 +01:00
|
|
|
- dev/*
|
2023-06-15 01:27:01 +02:00
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
2021-05-01 22:37:24 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and upload
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Git repo
|
2023-06-15 01:27:01 +02:00
|
|
|
uses: actions/checkout@v3
|
2021-05-01 22:37:24 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-05-19 13:34:00 +02:00
|
|
|
|
2023-06-15 01:27:01 +02:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
2021-05-01 22:37:24 +02:00
|
|
|
with:
|
2023-06-15 01:27:01 +02:00
|
|
|
distribution: 'temurin'
|
|
|
|
java-version: 17
|
2021-05-19 13:34:00 +02:00
|
|
|
|
2023-06-15 01:27:01 +02:00
|
|
|
- name: Setup Gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
2021-05-01 22:37:24 +02:00
|
|
|
|
|
|
|
- name: Build with Gradle
|
|
|
|
run: |
|
|
|
|
chmod +x gradlew
|
|
|
|
./gradlew build --stacktrace
|
2021-05-19 13:34:00 +02:00
|
|
|
|
2021-05-01 22:37:24 +02:00
|
|
|
- name: Archive plugin jars on GitHub
|
2023-06-15 01:27:01 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-01 22:37:24 +02:00
|
|
|
with:
|
|
|
|
name: EssentialsX plugin jars
|
|
|
|
path: jars/
|
|
|
|
|
|
|
|
- name: Deploy to Maven repo
|
|
|
|
if: ${{ success() && github.event_name == 'push' && github.repository == 'EssentialsX/Essentials' && github.ref == 'refs/heads/2.x' }}
|
|
|
|
env:
|
|
|
|
ORG_GRADLE_PROJECT_essxUsername: ${{ secrets.ESSENTIALSX_DEPLOY_USERNAME }}
|
|
|
|
ORG_GRADLE_PROJECT_essxPassword: ${{ secrets.ESSENTIALSX_DEPLOY_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
./gradlew publish
|
|
|
|
|
|
|
|
- name: Prepare Javadocs
|
|
|
|
run: |
|
|
|
|
mv Essentials/build/docs/javadoc/ javadocs/
|
2021-05-05 14:32:49 +02:00
|
|
|
cp -r EssentialsAntiBuild/build/docs/javadoc/ javadocs/EssentialsAntiBuild/
|
|
|
|
cp -r EssentialsChat/build/docs/javadoc/ javadocs/EssentialsChat/
|
2021-07-01 15:43:35 +02:00
|
|
|
cp -r EssentialsDiscord/build/docs/javadoc/ javadocs/EssentialsDiscord/
|
2022-12-25 22:14:20 +01:00
|
|
|
cp -r EssentialsDiscordLink/build/docs/javadoc/ javadocs/EssentialsDiscordLink/
|
2021-05-05 14:32:49 +02:00
|
|
|
cp -r EssentialsGeoIP/build/docs/javadoc/ javadocs/EssentialsGeoIP/
|
|
|
|
cp -r EssentialsProtect/build/docs/javadoc/ javadocs/EssentialsProtect/
|
|
|
|
cp -r EssentialsSpawn/build/docs/javadoc/ javadocs/EssentialsSpawn/
|
|
|
|
cp -r EssentialsXMPP/build/docs/javadoc/ javadocs/EssentialsXMPP/
|
2021-05-01 22:37:24 +02:00
|
|
|
|
2022-09-05 12:26:03 +02:00
|
|
|
- name: Archive Javadocs
|
2023-06-15 01:27:01 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-05-01 22:37:24 +02:00
|
|
|
with:
|
2022-09-05 12:26:03 +02:00
|
|
|
name: javadocs
|
|
|
|
path: javadocs/
|
|
|
|
|
|
|
|
publish-jd:
|
|
|
|
name: Publish Javadocs
|
|
|
|
needs: build
|
|
|
|
if: ${{ github.event_name == 'push' && github.repository == 'EssentialsX/Essentials' && github.ref == 'refs/heads/2.x' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
|
|
|
|
- name: Download Javadocs
|
2023-06-15 01:27:01 +02:00
|
|
|
uses: actions/download-artifact@v3
|
2022-09-05 12:26:03 +02:00
|
|
|
with:
|
|
|
|
name: javadocs
|
|
|
|
path: javadocs/
|
|
|
|
|
|
|
|
- name: Deploy Javadocs
|
|
|
|
run: npx netlify-cli deploy --dir=javadocs/ --prod --message="GitHubActionsDeploy"
|
2021-05-01 22:37:24 +02:00
|
|
|
env:
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_JD_AUTH_TOKEN }}
|
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_JD_2X_SITE_ID }}
|