-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4929f25
commit 260bba2
Showing
5 changed files
with
121 additions
and
126 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,90 +47,90 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
|
||
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }} | ||
run: echo ${{ github.event.inputs.distinct_id }} | ||
|
||
- 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 | ||
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 | ||
|
||
- name: Build | ||
run: ./gradlew build --stacktrace --warning-mode=fail | ||
|
||
- name: Create and push tag | ||
run: | | ||
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 "$MOD_VERSION" | ||
git push origin "$MOD_VERSION" | ||
- name: Close milestone | ||
if: ${{ inputs.close_milestone }} | ||
run: ./gradlew closeMilestone --stacktrace | ||
|
||
- name: Upload backups | ||
if: ${{ inputs.upload_backups }} | ||
run: ./gradlew uploadBackups --stacktrace | ||
|
||
- name: Publish to GitHub | ||
if: ${{ inputs.publish_github }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OLD_MCX_PUBLISH_TOKEN }} | ||
run: ./gradlew github --stacktrace | ||
|
||
- name: Build website update inputs | ||
id: website_inputs | ||
if: ${{ inputs.update_website }} | ||
run: | | ||
MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r') | ||
WURST_VERSION=$(echo "$MOD_VERSION" | sed 's/^v//' | 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') | ||
JSON_STRING=$(cat << EOF | ||
{ | ||
"wurst_version": "$WURST_VERSION", | ||
"mc_version": "$MC_VERSION", | ||
"fapi_version": "$FAPI_VERSION", | ||
"announce": "${{ inputs.announce_backport }}" | ||
} | ||
EOF | ||
) | ||
# Convert to single line and escape quotes | ||
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT" | ||
- name: Trigger website update | ||
id: website_dispatch | ||
if: ${{ inputs.update_website }} | ||
uses: codex-/return-dispatch@v2 | ||
with: | ||
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }} | ||
owner: Wurst-Imperium | ||
repo: WurstClient.net | ||
ref: gh-pages | ||
workflow: add_wurst_port.yml | ||
workflow_inputs: ${{ steps.website_inputs.outputs.json }} | ||
|
||
- name: Wait for website update to finish (run ${{ steps.website_dispatch.outputs.run_id }}) | ||
if: ${{ inputs.update_website }} | ||
uses: codex-/await-remote-run@v1 | ||
with: | ||
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }} | ||
owner: Wurst-Imperium | ||
repo: WurstClient.net | ||
run_id: ${{ steps.website_dispatch.outputs.run_id }} | ||
run_timeout_seconds: 600 # 10 minutes | ||
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }} | ||
run: echo ${{ github.event.inputs.distinct_id }} | ||
|
||
- 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 | ||
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 | ||
|
||
- name: Build | ||
run: ./gradlew build --stacktrace --warning-mode=fail | ||
|
||
- name: Create and push tag | ||
run: | | ||
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 "$MOD_VERSION" | ||
git push origin "$MOD_VERSION" | ||
- name: Close milestone | ||
if: ${{ inputs.close_milestone }} | ||
run: ./gradlew closeMilestone --stacktrace | ||
|
||
- name: Upload backups | ||
if: ${{ inputs.upload_backups }} | ||
run: ./gradlew uploadBackups --stacktrace | ||
|
||
- name: Publish to GitHub | ||
if: ${{ inputs.publish_github }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OLD_MCX_PUBLISH_TOKEN }} | ||
run: ./gradlew github --stacktrace | ||
|
||
- name: Build website update inputs | ||
id: website_inputs | ||
if: ${{ inputs.update_website }} | ||
run: | | ||
MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r') | ||
WURST_VERSION=$(echo "$MOD_VERSION" | sed 's/^v//' | 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') | ||
JSON_STRING=$(cat << EOF | ||
{ | ||
"wurst_version": "$WURST_VERSION", | ||
"mc_version": "$MC_VERSION", | ||
"fapi_version": "$FAPI_VERSION", | ||
"announce": "${{ inputs.announce_backport }}" | ||
} | ||
EOF | ||
) | ||
# Convert to single line and escape quotes | ||
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT" | ||
- name: Trigger website update | ||
id: website_dispatch | ||
if: ${{ inputs.update_website }} | ||
uses: codex-/return-dispatch@v2 | ||
with: | ||
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }} | ||
owner: Wurst-Imperium | ||
repo: WurstClient.net | ||
ref: gh-pages | ||
workflow: add_wurst_port.yml | ||
workflow_inputs: ${{ steps.website_inputs.outputs.json }} | ||
|
||
- name: Wait for website update to finish (run ${{ steps.website_dispatch.outputs.run_id }}) | ||
if: ${{ inputs.update_website }} | ||
uses: codex-/await-remote-run@v1 | ||
with: | ||
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }} | ||
owner: Wurst-Imperium | ||
repo: WurstClient.net | ||
run_id: ${{ steps.website_dispatch.outputs.run_id }} | ||
run_timeout_seconds: 600 # 10 minutes |
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