Updated to use new EventBus System... #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump Patch, Publish and Restart Discord Bot (Gradle) | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
publish: # Publish to maven | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 22 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Fix gradlew permissions (optional) | |
run: chmod +x gradlew | |
- name: Publish | |
env: | |
MAVEN_USERNAME: ${{ secrets.USERNAME }} # Reference the secret\ | |
MAVEN_PASSWORD: ${{ secrets.PASSWORD }} # Reference the secret\ | |
run: ./gradlew publish -DskipTests | |
restart: # Restart Bot | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Fix gradlew permissions (optional) | |
run: chmod +x gradlew | |
- name: Restart | |
env: | |
SERVER_ID: ${{ secrets.SERVER_ID }} # Reference the secret\ | |
SERVER_TOKEN: ${{ secrets.SERVER_TOKEN }} # Reference the secret\ | |
run: ./gradlew restartServer | |
regen: | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Regen | |
env: | |
WH_TOKEN: ${{ secrets.WH_TOKEN }} | |
run: | | |
curl --header "Authorization: Basic $WH_TOKEN" --header "Content-Type: application/json" --request POST --data "{\"group\": \"org.mangorage\", \"artifact\": \"mangobotplugin\"}" https://webhooks.minecraftforge.net/hooks/regen |