-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.21.3' into 1.21.3-neoforge
- Loading branch information
Showing
15 changed files
with
973 additions
and
137 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gradle" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "github-actions" | ||
# Directory should be `/` instead of `/.github/workflows` according to the docs. | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,113 @@ | ||
# Experimental workflow to automate updating to a new Minecraft snapshot. | ||
name: Auto Snapshot Update | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
mc_version: | ||
description: "Minecraft version to update to" | ||
required: true | ||
yarn_mappings: | ||
description: "Yarn mappings version" | ||
required: true | ||
fabric_loader: | ||
description: "Fabric Loader version" | ||
required: true | ||
fapi_version: | ||
description: "Fabric API version" | ||
required: true | ||
cf_game_version: | ||
description: "CurseForge GameVersion" | ||
required: true | ||
|
||
permissions: | ||
# To push changes to the new snapshot branch. | ||
contents: write | ||
# To trigger the CI workflow. | ||
actions: write | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# Include all branches in case the new snapshot branch already exists. | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Set up Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "21" | ||
distribution: "microsoft" | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" | ||
build-scan-terms-of-use-agree: "yes" | ||
|
||
- name: Create and checkout new snapshot branch | ||
run: | | ||
BRANCH_NAME="${{ github.event.inputs.mc_version }}" | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
if [ "$CURRENT_BRANCH" = "$BRANCH_NAME" ]; then | ||
echo "Already on branch $BRANCH_NAME. Skipping branch creation." | ||
elif git show-ref --quiet refs/heads/$BRANCH_NAME; then | ||
echo "Branch $BRANCH_NAME already exists but is not currently checked out. Failing the workflow." | ||
exit 1 | ||
else | ||
git checkout -b $BRANCH_NAME | ||
echo "Created and checked out new branch: $BRANCH_NAME" | ||
fi | ||
shell: bash | ||
|
||
- name: Run migrateMappings task | ||
run: | | ||
./gradlew migrateMappings --mappings ${{ github.event.inputs.yarn_mappings }} | ||
shell: bash | ||
|
||
- name: Replace src/main/java with remapped files | ||
run: | | ||
rm -rf ./src/main/java | ||
mv ./remappedSrc ./src/main/java | ||
shell: bash | ||
|
||
- name: Update version constants | ||
run: | | ||
python scripts/update_version_constants.py "${{ github.event.inputs.mc_version }}" "${{ github.event.inputs.yarn_mappings }}" "${{ github.event.inputs.fabric_loader }}" "${{ github.event.inputs.fapi_version }}" "${{ github.event.inputs.cf_game_version }}" | ||
shell: bash | ||
|
||
# To fix any style issues that the migration scripts might cause | ||
- name: Run spotlessApply task | ||
run: ./gradlew spotlessApply | ||
|
||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name "Wurst-Bot" | ||
git config --global user.email "[email protected]" | ||
git add . | ||
git commit -m "[Wurst-Bot] Update to ${{ github.event.inputs.mc_version }}" | ||
git push --set-upstream origin ${{ github.event.inputs.mc_version }} | ||
shell: bash | ||
|
||
# For some reason the commit above doesn't automatically trigger the CI | ||
# workflow, so we need to explicitly start it here. | ||
- name: Trigger CI on the new branch | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh workflow run gradle.yml --ref ${{ github.event.inputs.mc_version }} | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
name: Publish Release | ||
run-name: "Publish release from ${{ github.ref_name }} branch" | ||
|
||
permissions: | ||
# Needed to push the tag. | ||
contents: write | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -28,6 +33,11 @@ on: | |
required: true | ||
type: boolean | ||
default: true | ||
update_website: | ||
description: "Update wimods.net post (only works if there already is one and publish_curseforge is true)" | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
publish: | ||
|
@@ -37,9 +47,13 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# Include all tags in case the new tag already exists. | ||
fetch-tags: true | ||
|
||
- name: Set up Java 21 | ||
uses: actions/setup-java@v4 | ||
|
@@ -58,11 +72,11 @@ jobs: | |
|
||
- name: Create and push tag | ||
run: | | ||
MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' ') | ||
MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r') | ||
git config --global user.name "Wurst-Bot" | ||
git config --global user.email "[email protected]" | ||
git tag v$MOD_VERSION | ||
git push origin v$MOD_VERSION | ||
git tag "v$MOD_VERSION" | ||
git push origin "v$MOD_VERSION" | ||
- name: Close milestone | ||
if: ${{ inputs.close_milestone }} | ||
|
@@ -82,6 +96,31 @@ jobs: | |
if: ${{ inputs.publish_curseforge }} | ||
run: ./gradlew publishCurseforge --stacktrace | ||
|
||
- name: Get CurseForge file ID | ||
id: cf_file_id | ||
if: ${{ inputs.publish_curseforge }} | ||
run: | | ||
file_id=$(./gradlew getCurseforgeId | grep -o 'CURSEFORGE_FILE_ID=[0-9]*' | grep -o '[0-9]*') | ||
echo "file_id=$file_id" >> "$GITHUB_OUTPUT" | ||
echo "CurseForge file ID: `$file_id`" >> $GITHUB_STEP_SUMMARY | ||
- name: Publish to Modrinth | ||
if: ${{ inputs.publish_modrinth }} | ||
run: ./gradlew publishModrinth --stacktrace | ||
|
||
- name: Trigger website update | ||
if: ${{ inputs.update_website && inputs.publish_curseforge }} | ||
env: | ||
GH_TOKEN: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }} | ||
run: | | ||
MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r' | sed 's/-MC.*$//') | ||
MC_VERSION=$(grep "minecraft_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r') | ||
FAPI_VERSION=$(grep "fabric_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r') | ||
gh workflow run add_mod_port.yml \ | ||
-R Wurst-Imperium/wimods.net \ | ||
-f mod="mo-glass" \ | ||
-f modloader="fabric" \ | ||
-f mod_version="$MOD_VERSION" \ | ||
-f mc_version="$MC_VERSION" \ | ||
-f fapi_version="$FAPI_VERSION" \ | ||
-f file_id="${{ steps.cf_file_id.outputs.file_id }}" |
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
Oops, something went wrong.