ci: update publish to hangar plugin #62
Workflow file for this run
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: Publish Snapshots | |
on: | |
push: | |
branches: | |
- development | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Generate NMS Components | |
run: ./gradlew generateNmsComponents | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.OS }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: | | |
${{ runner.OS }}-gradle- | |
- name: Build with Gradle | |
run: ./gradlew shadowJar | |
- name: Publish to Hangar | |
env: | |
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }} | |
HANGAR_BUILD_CHANNEL: Snapshot | |
HANGAR_CHANGELOG: ${{ github.event.release.body }} | |
run: ./gradlew build publishPluginPublicationToHangar --stacktrace | |
- name: Publish to Modrinth | |
run: ./gradlew modrinth | |
env: | |
MODRINTH_BUILD_CHANNEL: beta | |
MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }} | |
MODRINTH_CHANGELOG: ${{ github.event.release.body }} |