Skip to content

🎨 formatting

🎨 formatting #1

Workflow file for this run

name: Upload Release Artifacts
on:
push:
tags: [ '*' ]
env:
JAVA_VERSION: 25
BUILD_NUMBER: ${{ github.run_number }}
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
TAG: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: read
steps:
# Setup
- name: Get time of build
id: time
run: echo BUILD_TIME=$(date -u --iso-8601=seconds) >> $GITHUB_OUTPUT
- uses: actions/checkout@v6
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'microsoft'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-encryption-key: ${{ secrets.GRADLE_CONFIG_CACHE_ENCRYPTION_KEY }}
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
# Build
- name: Build with Gradle
run: ./gradlew assemble
env:
BUILD_TIME: ${{ steps.time.outputs.BUILD_TIME }}
- name: Maven Release
if: ${{ env.MAVEN_UPLOAD_URL }}
run: ./gradlew publish
env:
BUILD_TIME: ${{ steps.time.outputs.BUILD_TIME }}
# Upload
- name: Upload build artifacts (Common)
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-Common-${{ env.TAG }}
path: |
Common/build/libs/*.jar
- name: Upload build artifacts (Fabric)
continue-on-error: true
uses: actions/upload-artifact@v6
with:
name: ${{ github.event.repository.name }}-Fabric-${{ env.TAG }}
path: |
Fabric/build/libs/*.jar
- name: Upload build artifacts (NeoForge)
continue-on-error: true
uses: actions/upload-artifact@v6
with:
name: ${{ github.event.repository.name }}-NeoForge-${{ env.TAG }}
path: |
NeoForge/build/libs/*.jar
- name: Generate build attestation
uses: actions/attest-build-provenance@v3
with:
subject-path: |
**/build/libs/*.jar
!**/build/libs/*-sources.jar
!**/build/libs/*-javadoc.jar
publish_github:
name: Publish (GitHub Releases)
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download build artifacts (Common)
uses: actions/download-artifact@v7
with:
name: ${{ github.event.repository.name }}-Common-${{ env.TAG }}
path: |
Common/build/libs
- name: Download build artifacts (Fabric)
uses: actions/download-artifact@v7
with:
name: ${{ github.event.repository.name }}-Fabric-${{ env.TAG }}
path: |
Fabric/build/libs
- name: Download build artifacts (NeoForge)
uses: actions/download-artifact@v7
with:
name: ${{ github.event.repository.name }}-NeoForge-${{ env.TAG }}
path: |
NeoForge/build/libs
- name: Publish (GitHub Releases)
id: publish_github
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
github-token: ${{ github.token }}
files: |
**/build/libs/*.jar
publish_platforms:
name: Publish (${{ matrix.platform }}, ${{ matrix.loader }})
strategy:
fail-fast: false
matrix:
platform: [ 'Curseforge', 'Modrinth' ]
loader: [ 'Fabric', 'NeoForge' ]
needs: build
runs-on: ubuntu-latest
outputs:
modrinth_id: ${{ steps.store_ids.outputs.Fabric_modrinth_id }}
curseforge_id: ${{ steps.store_ids.outputs.Fabric_curseforge_id }}
steps:
- name: Download build artifacts (${{ matrix.loader }})
uses: actions/download-artifact@v7
with:
name: ${{ github.event.repository.name }}-${{ matrix.loader }}-${{ env.TAG }}
path: ${{ matrix.loader }}/build/libs
- name: Publish (Modrinth)
id: publish_modrinth
if: matrix.platform == 'Modrinth'
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
version: ${{ env.TAG }}+${{ matrix.loader }}
version-type: beta
files: |
${{ matrix.loader }}/build/libs/!(*-@(sources|javadoc)).jar
${{ matrix.loader }}/build/libs/*-@(sources|javadoc).jar
- name: Publish (Curseforge)
id: publish_curseforge
if: matrix.platform == 'Curseforge'
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
version: ${{ env.TAG }}+${{ matrix.loader }}
version-type: beta
files: |
${{ matrix.loader }}/build/libs/!(*-@(sources|javadoc)).jar
${{ matrix.loader }}/build/libs/*-@(sources|javadoc).jar
- name: Store Platform IDs
id: store_ids
run: |
echo "${{ matrix.loader }}_modrinth_id=${{ steps.publish_modrinth.outputs.modrinth-id }}" >> $GITHUB_OUTPUT
echo "${{ matrix.loader }}_curseforge_id=${{ steps.publish_curseforge.outputs.curseforge-id }}" >> $GITHUB_OUTPUT
notify:
name: Notify
needs: [ publish_github, publish_platforms ]
runs-on: ubuntu-latest
steps:
- name: Notify Discord
uses: Up-Mods/action-discord-release@main
with:
project-name: Popping Presents
version: ${{ env.TAG }}
webhook-url: ${{ secrets.ANNOUNCEMENT_WEBHOOK_URL }}
curseforge-project-id: ${{ needs.publish_platforms.outputs.curseforge_id }}
modrinth-project-id: ${{ needs.publish_platforms.outputs.modrinth_id }}
ping-notification-role: false
# thumbnail-url:
- name: Notify Discord (KiriCattus)
uses: Up-Mods/action-discord-release@main
with:
project-name: Popping Presents
version: ${{ env.TAG }}
webhook-url: ${{ secrets.KIRICATTUS_ANNOUNCEMENT_WEBHOOK_URL }}
webhook-username: "Mod Update News"
curseforge-project-id: ${{ needs.publish_platforms.outputs.curseforge_id }}
modrinth-project-id: ${{ needs.publish_platforms.outputs.modrinth_id }}
ping-notification-role: false
# thumbnail-url: