-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publishing Workflow, Changelog and Readme update
- Loading branch information
Showing
7 changed files
with
226 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
# 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: [pull_request, push] | ||
on: [ pull_request, push ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
# Use these Java versions | ||
java: [ | ||
21, # Current Java LTS | ||
] | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v2 | ||
- name: setup jdk ${{ matrix.java }} | ||
- name: Validate gradle wrapper | ||
uses: gradle/actions/wrapper-validation@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'microsoft' | ||
- name: make gradle wrapper executable | ||
distribution: 'adopt' | ||
java-version: 21 | ||
- name: Make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: build | ||
- name: Build | ||
run: ./gradlew build | ||
- name: capture build artifacts | ||
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java | ||
|
||
- name: Upload build artifacts | ||
if: ${{ github.event_name == 'push' }} # Only upload artifacts on push | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Artifacts | ||
name: build-artifacts | ||
path: build/libs/ |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Publish Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
type: choice | ||
description: Release Type | ||
options: | ||
- stable | ||
- beta | ||
- alpha | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java | ||
run: echo "JAVA_HOME=$JAVA_HOME_21_X64" >> "$GITHUB_ENV" | ||
|
||
- name: Loom Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: "**/.gradle/loom-cache" | ||
key: "${{ runner.os }}-gradle-loom-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}" | ||
restore-keys: "${{ runner.os }}-gradle-loom-" | ||
- name: ModDevGradle Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: "**/.gradle/repositories" | ||
key: "${{ runner.os }}-gradle-mdg-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}" | ||
restore-keys: "${{ runner.os }}-gradle-mdg-" | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
cache-read-only: true | ||
|
||
- name: Validate Gradle Wrapper Integrity | ||
uses: gradle/wrapper-validation-action@v2 | ||
|
||
- name: make gradle wrapper executable | ||
run: chmod +x gradlew | ||
|
||
- name: Gradle Release Build | ||
env: | ||
RELEASE_WORKFLOW: true | ||
run: ./gradlew build | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo "MINECRAFT_VERSION=$(./gradlew -q printMinecraftVersion)" >> $GITHUB_ENV | ||
echo "MOD_VERSION=$(./gradlew -q printModVersion)" >> $GITHUB_ENV | ||
echo "MIN_MINECRAFT_VERSION=$(./gradlew -q printMinMinecraftVersion)" >> $GITHUB_ENV | ||
echo "MAX_MINECRAFT_VERSION=$(./gradlew -q printMaxMinecraftVersion)" >> $GITHUB_ENV | ||
- name: Replace placeholders in CHANGELOG.md | ||
run: | | ||
sed -i 's/_ReleaseTag_/mc${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}/g' CHANGELOG.md | ||
sed -i 's/_MCVersion_/${{ env.MINECRAFT_VERSION }}/g' CHANGELOG.md | ||
sed -i 's/_ModVersion_/${{ env.MOD_VERSION }}/g' CHANGELOG.md | ||
sed -i 's/_MinMCVersion_/${{ env.MIN_MINECRAFT_VERSION }}/g' CHANGELOG.md | ||
sed -i 's/_MaxMCVersion_/${{ env.MAX_MINECRAFT_VERSION }}/g' CHANGELOG.md | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create mc${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }} \ | ||
--title="${{ env.RELEASE_NAME }}" \ | ||
--notes-file=CHANGELOG.md \ | ||
--target=${{ github.ref_name }} \ | ||
--draft=false \ | ||
--prerelease=${{ inputs.releaseType != 'stable' }} \ | ||
build/libs/*.jar | ||
- name: Build & Publish | ||
env: | ||
RELEASE_TYPE: ${{ inputs.releaseType }} | ||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }} | ||
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} | ||
run: ./gradlew publishMods |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Rail Placement Fix _ModVersion_ for Minecraft versions _MinMCVersion_ - _MaxMCVersion_ adds a new fix for the orientation of all player placed rails. | ||
Please report any rail-related issues you encounter to the [issue tracker of Rail Placement Fix](https://github.com/2No2Name/rail-placement-fix/issues). | ||
|
||
## Additions: | ||
|
||
- Fix player placed rails trying to connect to partially connected straight rails |
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
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