diff options
author | LifeIsAParadox <LifeIsAParadox@users.noreply.github.com> | 2022-01-25 00:59:23 +0100 |
---|---|---|
committer | LifeIsAParadox <LifeIsAParadox@users.noreply.github.com> | 2022-01-25 00:59:23 +0100 |
commit | bdbf2074eb548900d780d3989d19ddb089699609 (patch) | |
tree | 6750b53961db697de266a7819278547aa64c0e03 | |
parent | 4ceec17c35386dfd2c4178120c13da7b1c4eb88f (diff) | |
download | Skyblocker-bdbf2074eb548900d780d3989d19ddb089699609.tar.gz Skyblocker-bdbf2074eb548900d780d3989d19ddb089699609.tar.bz2 Skyblocker-bdbf2074eb548900d780d3989d19ddb089699609.zip |
[skip ci]
-rw-r--r-- | .github/workflows/buildrelease.yml | 92 | ||||
-rw-r--r-- | build.gradle | 5 | ||||
-rw-r--r-- | gradle.properties | 3 | ||||
-rw-r--r-- | src/main/resources/fabric.mod.json | 5 |
4 files changed, 99 insertions, 6 deletions
diff --git a/.github/workflows/buildrelease.yml b/.github/workflows/buildrelease.yml new file mode 100644 index 00000000..b1fa84d8 --- /dev/null +++ b/.github/workflows/buildrelease.yml @@ -0,0 +1,92 @@ +# This is a basic workflow to help you get started with Actions
+
+name: Build Release
+
+# Controls when the action will run. Triggers the workflow on push or pull request
+# events but only for the master branch
+on:
+ release:
+ types: [created]
+
+jobs:
+ # This workflow contains a single job called "build"
+ build:
+ # The type of runner that the job will run on
+ runs-on: ubuntu-latest
+ # Steps represent a sequence of tasks that will be executed as part of the job
+ steps:
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v2
+ - name: Set up JDK 17
+ uses: actions/setup-java@v2
+ with:
+ distribution: 'adopt'
+ java-version: '17'
+
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+
+ - name: Build with Gradle
+ run: ./gradlew build
+
+ - uses: actions/upload-artifact@v2
+ with:
+ name: Artifacts
+ path: build/libs/
+
+ - name: Read Changelog
+ id: read_changelog
+ shell: bash
+ run: |
+ CHANGELOG=$(sed '/___/Q' CHANGELOG.md | grep -v '# ')
+ echo "Changelog:\n$CHANGELOG"
+ CHANGELOG="${CHANGELOG//'%'/'%25'}"
+ CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
+ CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
+ echo "::set-output name=changelog::$CHANGELOG"
+
+ - uses: actions/github-script@v2
+ id: fname
+ with:
+ result-encoding: string
+ script: |
+ const fs = require("fs")
+ return fs.readdirSync("build/libs/").filter(e => !e.endsWith("dev.jar") && !e.endsWith("sources.jar") && e.endsWith(".jar"))[0]
+ - name: Release
+ id: uploadrelease
+ uses: softprops/action-gh-release@v1
+ with:
+ body: ${{ steps.read_changelog.outputs.changelog }}
+ files: build/libs/${{ steps.fname.outputs.result }}
+
+ - name: Publish to Modrinth
+ id: modrinth
+ env:
+ MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
+ CHANGELOG: ${{ steps.read_changelog.outputs.changelog }}
+ run: ./gradlew publishModrinth
+
+ - name: Get version tag
+ id: version_tag
+ run: |
+ [[ ! "$GITHUB_REF" =~ refs/tags ]] && exit
+ echo "::set-output name=value::${GITHUB_REF#refs/tags/}"
+
+ - name: Discord notification
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+ uses: Ilshidur/action-discord@master
+ with:
+ args: |
+ "@here"
+ "Skyblocker ${{ steps.version_tag.outputs.value }}"
+ ""
+ "Changelog"
+ "```md"
+ "${{ steps.read_changelog.outputs.changelog }}"
+ "```"
+ ":inbox_tray: Download latest version on Modrinth or Github:"
+ "<:modrinth:900697862206287882> <${{ steps.modrinth.outputs.url }}>"
+ "<:github:900697885706952725> <${{ steps.uploadrelease.outputs.url }}>"
+ ""
+ "<https://hysky.de/>"
\ No newline at end of file diff --git a/build.gradle b/build.gradle index fc535314..a05703ab 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name -version = "${project.mod_version}+${project.minecraft_version}" +version = "${project.mod_version}+${project.suported_version}" group = project.maven_group repositories { @@ -103,8 +103,9 @@ task publishModrinth(type: TaskModrinthUpload) { token = System.getenv('MODRINTH_TOKEN') projectId = project.modrinth_id versionNumber = "v${project.version}" - versionName = "Skyblocker ${project.mod_version} (${project.minecraft_version})" + versionName = "Skyblocker ${project.mod_version} (${project.suported_version})" uploadFile = remapJar + addGameVersion('1.17.1') addGameVersion((String) project.minecraft_version) addLoader('fabric') versionType = VersionType.RELEASE diff --git a/gradle.properties b/gradle.properties index a9840524..3952ba70 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,4 +18,5 @@ mod_menu_version=3.0.0 mod_version = 1.4.3 maven_group = me.xmrvizzy archives_base_name = skyblocker -modrinth_id=y6DuFGwJ
\ No newline at end of file +modrinth_id=y6DuFGwJ +suported_version=1.17.x-1.18.x
\ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 09320692..8ef1482d 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -5,7 +5,7 @@ "name": "Skyblocker", "description": "Hypixel Skyblock Mod", "authors": ["xMrVizzy", "d3dx9", "LifeIsAParadox"], - "contributors": ["ExternalTime", "Zailer43"], + "contributors": ["ExternalTime", "Zailer43", "TacoMonkey"], "contact": { "homepage": "https://hysky.de", "sources": "https://github.com/LifeIsAParadox/Skyblocker", @@ -29,8 +29,7 @@ "fabricloader": ">=0.12.11", "fabric": "*", "cloth-config2": "*", - "minecraft": "1.18.x", - "java": ">=17" + "minecraft": ["1.18.x","1.17.x"] }, "custom": { "modmenu": { |