-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
34 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,16 @@ name: publish | |
|
||
on: | ||
release: | ||
types: [published] | ||
types: [ published ] | ||
|
||
jobs: | ||
build: | ||
name: publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
outputs: | ||
mc_version: ${{ steps.split_tag.outputs.mc_version }} | ||
mod_version: ${{ steps.split_tag.outputs.mod_version }} | ||
|
||
steps: | ||
- name: Extract Version from Tag | ||
id: split_tag | ||
run: | | ||
|
@@ -20,60 +21,76 @@ jobs: | |
echo "mod_version=${parts[1]}" >> $GITHUB_OUTPUT | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/cache@v3 | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: ubuntu-latest-gradle- | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v2 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew -PmodVersion='${{ steps.split_tag.outputs.mod_version }}' build | ||
|
||
- name: Remove extra JARs | ||
- name: Remove shadow JARs | ||
run: | | ||
rm fabric/build/libs/*-dev-shadow.jar | ||
rm forge/build/libs/*-dev-shadow.jar | ||
rm neoforge/build/libs/*-dev-shadow.jar | ||
- name: Add Artifacts to Github Release | ||
uses: alexellis/[email protected].0 | ||
uses: alexellis/[email protected].1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
asset_paths: '["./forge/build/libs/*.jar","./fabric/build/libs/*.jar","./common/build/libs/*-api.jar"]' | ||
asset_paths: '["./fabric/build/libs/*.jar","./forge/build/libs/*.jar","./neoforge/build/libs/*.jar","./common/build/libs/*-api.jar"]' | ||
|
||
- name: Publish to Curseforge and Minotaur (Forge) | ||
uses: Kir-Antipov/[email protected] | ||
- uses: actions/upload-artifact@v4 | ||
name: Upload Artifacts | ||
id: upload-artifacts | ||
with: | ||
name: ${{ github.event.repository.name }}-MC${{ steps.split_tag.outputs.mc_version }}-${{ steps.split_tag.outputs.mod_version }} | ||
version: MC${{ steps.split_tag.outputs.mc_version }}-forge-${{ steps.split_tag.outputs.mod_version }} | ||
java: Java 17 | ||
name: jar-files | ||
path: | | ||
./common/build/libs/*-api.jar | ||
./fabric/build/libs/*.jar | ||
./forge/build/libs/*.jar | ||
./neoforge/build/libs/*.jar | ||
retention-days: 1 | ||
|
||
files: | | ||
forge/build/libs/*.jar | ||
common/build/libs/*-api.jar | ||
publish: | ||
strategy: | ||
matrix: | ||
loader: [ fabric, forge, neoforge ] | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | ||
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: jar-files | ||
|
||
- name: Publish to Curseforge and Minotaur (Fabric) | ||
- name: Publish (${{ matrix.loader }}) | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
name: ${{ github.event.repository.name }}-MC${{ steps.split_tag.outputs.mc_version }}-${{ steps.split_tag.outputs.mod_version }} | ||
version: MC${{ steps.split_tag.outputs.mc_version }}-fabric-${{ steps.split_tag.outputs.mod_version }} | ||
name: ${{ github.event.repository.name }}-MC${{ needs.build.outputs.mc_version }}-${{ needs.build.outputs.mod_version }} | ||
version: MC${{ needs.build.outputs.mc_version }}-${{ matrix.loader }}-${{ needs.build.outputs.mod_version }} | ||
java: Java 17 | ||
|
||
files: | | ||
fabric/build/libs/*.jar | ||
common/build/libs/*-api.jar | ||
${{ matrix.loader }}/build/libs/*.jar | ||
modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | ||
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} |