Build #26
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| is-release: | |
| description: 'Publish release to Modrinth, Curseforge and Github' | |
| required: false | |
| default: false | |
| type: boolean | |
| dry-run: | |
| description: 'Dry Run the release, only send Discord Webhook' | |
| required: false | |
| default: true | |
| type: boolean | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Java 21 | |
| run: echo "JAVA_HOME=$JAVA_HOME_21_X64" >> "$GITHUB_ENV" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-disabled: ${{ inputs.is-release }} | |
| cache-read-only: false | |
| - name: Build | |
| run: ./gradlew build | |
| - name: Maven Release | |
| if: ${{ inputs.is-release && !inputs.dry-run }} | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| run: ./gradlew publish | |
| - name: Publish | |
| if: ${{ inputs.is-release }} | |
| env: | |
| MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
| CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| DISCORD_WEBHOOK_DRY_RUN: ${{ secrets.DISCORD_WEBHOOK_DRY_RUN }} | |
| DRY_RUN: ${{ inputs.dry-run }} | |
| run: ./gradlew publishMods |