Skip to content

Commit

Permalink
chore: Add changelog, update to latest version of build and release file
Browse files Browse the repository at this point in the history
  • Loading branch information
magicus committed Apr 27, 2024
1 parent 71e51fb commit 1296cc4
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 26 deletions.
54 changes: 28 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1296cc4

Please sign in to comment.