diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e1589c2..d8f5180 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -6,16 +6,16 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Validate gradlew integrity - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -35,7 +35,7 @@ jobs: run: | VERSION=$(awk -F '=' '/^version/ { print $2; }' build.properties) BUILD=$(awk -F '=' '/build_number/ { print $2; }' build.properties) - echo "forge=build/libs/Morph-o-Tool-${VERSION}-${BUILD}.jar" >> "$GITHUB_OUTPUT" + echo "neoforge=build/libs/Morph-o-Tool-${VERSION}-${BUILD}.jar" >> "$GITHUB_OUTPUT" - name: Sign jars env: SIGNING_KEY: ${{ secrets.VIOLET_MOON_SIGNING_KEY }} @@ -43,20 +43,20 @@ jobs: run: | echo "${SIGNING_KEY}" | gpg --import - gpg --local-user "Violet Moon Signing Key" --armor \ - --detach-sign ${{ steps.calculate_artifact_names.outputs.forge }} - - name: Archive Forge Artifacts - uses: actions/upload-artifact@v2 + --detach-sign ${{ steps.calculate_artifact_names.outputs.neoforge }} + - name: Archive NeoForge Artifacts + uses: actions/upload-artifact@v4 with: - name: Forge + name: NeoForge path: | - ${{ steps.calculate_artifact_names.outputs.forge }} - ${{ steps.calculate_artifact_names.outputs.forge }}.asc + ${{ steps.calculate_artifact_names.outputs.neoforge }} + ${{ steps.calculate_artifact_names.outputs.neoforge }}.asc - name: Upload Releases if: startsWith(github.ref, 'refs/tags/release-') env: GH_TOKEN: ${{ github.token }} GIT_REF: ${{ github.ref }} - FORGE_JAR: ${{ steps.calculate_artifact_names.outputs.forge }} + NEOFORGE_JAR: ${{ steps.calculate_artifact_names.outputs.neoforge }} CURSEFORGE_TOKEN: ${{ secrets.VAZKII_CURSEFORGE_TOKEN }} MODRINTH_TOKEN: ${{ secrets.VAZKII_MODRINTH_TOKEN }} run: | diff --git a/push_tag.py b/push_tag.py index 6675f61..105ed9f 100644 --- a/push_tag.py +++ b/push_tag.py @@ -2,34 +2,36 @@ import re from jproperties import Properties + def main(): - build = Properties() - with open('build.properties', 'rb') as f: - build.load(f , "utf-8") - - mc_version, mcv_meta = build['mc_version'] - version, v_meta = build['version'] - build_number, bn_meta = build['build_number'] - - print('MC Version:', mc_version) - print('Version:', version) - print('Build Number', build_number) - - changelog = '-m "Changelog:" ' - with open('changelog.txt', 'r') as f: - content = f.read() - - content = content.replace('"', '\''); - changelog = changelog + re.sub(r'(- .+)\n?', '-m "\g<1>" ', content) - - os.system('git tag -a release-{}-{}-{} {}'.format(mc_version, version, build_number, changelog)) - - build['build_number'] = str(int(build_number) + 1) - with open("build.properties", "wb") as f: - build.store(f, encoding="utf-8") - - os.system('git commit -a -m build') - os.system('git push origin master release-{}-{}-{}'.format(mc_version, version, build_number)) + build = Properties() + with open('build.properties', 'rb') as f: + build.load(f, "utf-8") + + mc_version, mcv_meta = build['mc_version'] + version, v_meta = build['version'] + build_number, bn_meta = build['build_number'] + + print('MC Version:', mc_version) + print('Version:', version) + print('Build Number', build_number) + + changelog = '-m "Changelog:" ' + with open('changelog.txt', 'r') as f: + content = f.read() + + content = content.replace('"', '\''); + changelog = changelog + re.sub(r'(- .+)\n?', '-m "\g<1>" ', content) + + os.system('git tag -a release-{}-{}-{} {}'.format(mc_version, version, build_number, changelog)) + + build['build_number'] = str(int(build_number) + 1) + with open("build.properties", "wb") as f: + build.store(f, encoding="utf-8") + + os.system('git commit -a -m build') + os.system('git push origin master release-{}-{}-{}'.format(mc_version, version, build_number)) + if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/scripts/upload_releases.sh b/scripts/upload_releases.sh index 3efe2f1..a3b750c 100755 --- a/scripts/upload_releases.sh +++ b/scripts/upload_releases.sh @@ -19,19 +19,19 @@ function release_github() { -f tag_name="${TAGNAME}")" GH_RELEASE_PAGE=$(echo "$GH_RELEASE_RESPONSE" | jq -r .html_url) - echo >&2 'Uploading Forge Jar and Signature to GitHub' - gh release upload "${TAGNAME}" "${FORGE_JAR}#Forge Jar" - gh release upload "${TAGNAME}" "${FORGE_JAR}.asc#Forge Signature" + echo >&2 'Uploading NeoForge Jar and Signature to GitHub' + gh release upload "${TAGNAME}" "${NEOFORGE_JAR}#NeoForge Jar" + gh release upload "${TAGNAME}" "${NEOFORGE_JAR}.asc#NeoForge Signature" } function release_modrinth() { - echo >&2 'Uploading Forge Jar to Modrinth' - local MODRINTH_FORGE_SPEC - MODRINTH_FORGE_SPEC=$(cat <&2 'Uploading NeoForge Jar to Modrinth' + local MODRINTH_NEOFORGE_SPEC + MODRINTH_NEOFORGE_SPEC=$(cat <&2 'Uploading Forge Jar to CurseForge' - local CURSEFORGE_FORGE_SPEC - CURSEFORGE_FORGE_SPEC=$(cat <&2 'Uploading NeoForge Jar to CurseForge' + local CURSEFORGE_NEOFORGE_SPEC + CURSEFORGE_NEOFORGE_SPEC=$(cat <