Skip to content

.github/workflows/release.yml #3

.github/workflows/release.yml

.github/workflows/release.yml #3

Workflow file for this run

on:
workflow_dispatch:
inputs:
github-release:
type: boolean
hangar:
type: boolean
github-packages:
type: boolean
modrinth:
type: boolean
permissions:
contents: write
packages: write
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version-file: .java-version
- name: Build
run: chmod +x ./gradlew && ./gradlew build
- uses: actions/upload-artifact@v7
with:
path: build/libs/*.jar
archive: false
- id: get_version
run: |
RESULT=$(./gradlew -q printVersion)
echo "version=$RESULT" >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@v3
if: ${{ inputs.github-release }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
files: build/libs/*
generate_release_notes: true
- run: ./gradlew publishAllPublicationsToHangar syncPluginPublicationMainResourcePagePageToHangar --stacktrace
if: ${{ inputs.hangar }}
env:
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
- run: ./gradlew modrinth modrinthSyncBody
if: ${{ inputs.modrinth }}
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- run: ./gradlew publish
if: ${{ inputs.github-packages }}
env:
GITHUB_PACKAGES_USERNAME: Kiber2009
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}