mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-15 03:50:14 +08:00
97 lines
2.9 KiB
YAML
97 lines
2.9 KiB
YAML
name: Build EssentialsX
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 2.x
|
|
- dev/*
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and upload
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Git repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Restore Gradle cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/caches
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Set up JDK 16
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: 'adopt'
|
|
java-version: 16
|
|
|
|
- name: Validate Gradle Wrapper
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
- name: Build with Gradle
|
|
run: |
|
|
chmod +x gradlew
|
|
./gradlew build --stacktrace
|
|
|
|
- name: Archive plugin jars on GitHub
|
|
uses: actions/upload-artifact@master
|
|
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/
|
|
cp -r EssentialsAntiBuild/build/docs/javadoc/ javadocs/EssentialsAntiBuild/
|
|
cp -r EssentialsChat/build/docs/javadoc/ javadocs/EssentialsChat/
|
|
cp -r EssentialsDiscord/build/docs/javadoc/ javadocs/EssentialsDiscord/
|
|
cp -r EssentialsDiscordLink/build/docs/javadoc/ javadocs/EssentialsDiscordLink/
|
|
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/
|
|
|
|
- name: Archive Javadocs
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
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
|
|
uses: actions/download-artifact@master
|
|
with:
|
|
name: javadocs
|
|
path: javadocs/
|
|
|
|
- name: Deploy Javadocs
|
|
run: npx netlify-cli deploy --dir=javadocs/ --prod --message="GitHubActionsDeploy"
|
|
env:
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_JD_AUTH_TOKEN }}
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_JD_2X_SITE_ID }}
|