generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 65
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
3 changed files
with
18 additions
and
31 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ jobs: | |
matrix: | ||
java: [ 16 ] | ||
os: [ ubuntu-20.04 ] | ||
branch: [ 1.16, 1.17 ] | ||
branch: [ 1.16, 1.17, 1.18 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout repository | ||
|
@@ -22,35 +22,25 @@ jobs: | |
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- name: Display build number | ||
run: echo MasaGadget build\#$GITHUB_RUN_NUMBER \(Public Release\) | ||
- name: Set build number in codes | ||
run: | | ||
sed -i "s/build.undefined/build.$GITHUB_RUN_NUMBER/g" gradle.properties | ||
sed -i "s/build.undefined/build.$GITHUB_RUN_NUMBER/g" src/main/java/com/plusls/MasaGadget/ModInfo.java | ||
sed -i "s/Version Exception/Public Release/g" src/main/java/com/plusls/MasaGadget/ModInfo.java | ||
sed -i "s/-alpha.114514//g" gradle.properties | ||
- name: make gradle wrapper executable | ||
if: ${{ runner.os != 'Windows' }} | ||
run: chmod +x ./gradlew | ||
- name: copy linux deps | ||
if: ${{ runner.os != 'Windows' }} | ||
run: mkdir -p build/loom-cache && cp ./deps/* ./build/loom-cache/. | ||
- name: copy windows deps | ||
if: ${{ runner.os == 'Windows' }} | ||
run: mkdir build\\loom-cache && copy .\deps\* .\\build\\loom-cache | ||
- name: build | ||
run: ./gradlew build | ||
- name: Upload assets to GitHub | ||
uses: AButler/[email protected] | ||
if: ${{ runner.os == 'Linux' && matrix.java == '16' }} | ||
with: | ||
files: 'build/libs/*;LICENSE' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Find correct JAR | ||
id: findjar | ||
run: | | ||
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")" | ||
echo "::set-output name=jarname::$output" | ||
- name: Upload assets to GitHub | ||
uses: AButler/[email protected] | ||
if: ${{ runner.os == 'Linux' && matrix.java == '16' }} | ||
with: | ||
files: build/libs/${{ steps.findjar.outputs.jarname }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload to Curseforge | ||
uses: itsmeow/curseforge-upload@v3 | ||
with: | ||
|
@@ -61,5 +51,11 @@ jobs: | |
changelog_type: markdown | ||
changelog: ${{ github.event.release.body }} | ||
# 1.16.5:8203, 1.17:8516, fabric:7499 | ||
game_versions: ${{ fromJson('{"1.16":"8203","1.17":"8516"}')[matrix.branch] }}, 7499 | ||
release_type: release | ||
game_versions: ${{ fromJson('{"1.16":"8203","1.17":"8516","1.18":"8633"}')[matrix.branch] }}, 7499 | ||
release_type: release | ||
- name: Upload to Modrinth | ||
if: ${{ runner.os == 'Linux' && matrix.java == '16' }} | ||
run: | | ||
./gradlew publishModrinth | ||
env: | ||
MODRINTH: ${{ secrets.MODRINTH }} |
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