diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b8cb84..0060f5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,35 +1,37 @@ -# Automatically build the project and run any configured tests for every push -# and submitted pull request. This can help catch issues that only occur on -# certain platforms or Java versions, and provides a first line of defence -# against bad commits. +name: Build on Push/PR -name: build -on: [pull_request, push] +on: + pull_request: + push: + workflow_dispatch: + +env: + JAVA_VERSION: 17 jobs: build: - strategy: - matrix: - java: [17] # We only support JDK 17 in master branch - os: [ubuntu-20.04] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - name: checkout repository - uses: actions/checkout@v2 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v2 + - name: Check out source code + uses: actions/checkout@v4 + + - name: Validate Gradle wrapper + uses: gradle/actions/wrapper-validation@v3 + + - name: Setup JDK + uses: actions/setup-java@v4 with: - distribution: adopt - java-version: ${{ matrix.java }} - - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlew - - name: build - run: ./gradlew build - - name: upload build artifacts - uses: actions/upload-artifact@v2 + distribution: "temurin" + java-version: "${{env.JAVA_VERSION}}" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + run: gradle build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 with: name: Artifacts path: build/libs/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6cb7326 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,95 @@ +name: Release on tag + +on: + workflow_dispatch: + push: + tags: + - '*' + +env: + JAVA_VERSION: 17 + MODRINTH_ID: 'mfDfQvcJ' + CURSEFORGE_ID: '544608' + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Check out source code + uses: actions/checkout@v4 + + - name: Validate Gradle wrapper + uses: gradle/actions/wrapper-validation@v3 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '${{env.JAVA_VERSION}}' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + run: gradle build + + - name: Get version numbers from tag + id: version + run: | + # Extract mod and minecraft version from tag + mod_version=${GITHUB_REF_NAME#v} + mod_version="${mod_version%+*}" + minecraft_version=${GITHUB_REF_NAME#*+} + echo "mod=$mod_version" >> $GITHUB_OUTPUT + echo "minecraft=$minecraft_version" >> $GITHUB_OUTPUT + echo "full=$mod_version+$minecraft_version" >> $GITHUB_OUTPUT + echo Mod version: $mod_version + echo Minecraft version: $minecraft_version + + - name: Install parse-changelog + uses: taiki-e/install-action@v2 + with: + tool: parse-changelog + + - name: Parse changelog + id: changelog + continue-on-error: true + run: | + # Extract the changelog entry for this release + mkdir -p output + changelog=output/changelog.md + parse-changelog CHANGELOG.md ${{ steps.version.outputs.full }} > $changelog || true + if [[ ! -s $changelog ]]; then + # No changelog for specific version (mod+minecraft), try just mod version + parse-changelog CHANGELOG.md ${{ steps.version.outputs.mod }} > $changelog || true + fi + if [[ ! -s $changelog ]]; then + echo "No changelog available" > $changelog + fi + echo Extracted changelog for this release: + cat $changelog + echo "file=$changelog" >> $GITHUB_OUTPUT + + - name: Publish release + id: publish + uses: Kir-Antipov/mc-publish@v3.3 + with: + modrinth-id: ${{ env.MODRINTH_ID }} + curseforge-id: ${{ env.CURSEFORGE_ID }} + github-token: ${{ secrets.MY_GITHUB_TOKEN }} + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + name: Mod Settings ${{ steps.version.outputs.mod }} (${{ steps.version.outputs.minecraft }}) + version: ${{ steps.version.outputs.full }} + version-type: release + changelog-file: ${{ steps.changelog.outputs.file }} + dependencies: | + fabric-api(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github) + + - name: Show results + run: | + # Show results from mc-publish + echo Successfully published Mod Settings ${{ steps.version.outputs.full }} + echo Modrinth release ${{ steps.publish.outputs.modrinth-version }}: ${{ steps.publish.outputs.modrinth-url }} + echo CurseForge release ${{ steps.publish.outputs.curseforge-version }}: ${{ steps.publish.outputs.curseforge-url }} + echo GitHub release ${{ steps.publish.outputs.github-tag }}: ${{ steps.publish.outputs.github-url }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e0939f5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +## 1.1.0+1.17.1 - 2022-04-17 + +### Added + +- 1.1.0 on Minecraft 1.17.1 + +## 1.1.0 - 2022-04-17 + +### Added + +- Add a hotkey to bring up the Mod Settings screen + +### Fixed + +- Fixes multiple incompatibilities with other mods + +## 1.0.0+1.18.1 - 2022-01-20 + +### Added + +- Support for Minecraft 1.18.1 + +## 1.0.0 - 2021-11-06 + +### Added + +- First release