-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Showing
4 changed files
with
152 additions
and
20 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,17 +1,18 @@ | ||
# 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: | ||
# Dependabot version updates, see: | ||
# 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" | ||
- package-ecosystem: "gradle" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "06:00" | ||
timezone: "Europe/Berlin" | ||
- package-ecosystem: "github-actions" | ||
# Directory should be `/` instead of `/.github/workflows` according to the docs. | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "06:00" | ||
timezone: "Europe/Berlin" |
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,131 @@ | ||
name: Publish Multiple Releases | ||
run-name: Publish v${{ github.event.inputs.mod_version }} build(s) from ${{ github.event.inputs.branches }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
mod_version: | ||
description: "Mod version (without v or -MC)" | ||
required: true | ||
type: string | ||
branches: | ||
description: "Space-separated list of branches to publish from" | ||
required: true | ||
type: string | ||
announce_ports: | ||
description: "Announce as ports on WurstForum" | ||
required: true | ||
type: boolean | ||
default: false | ||
dry_run: | ||
description: "Dry-run mode (don't actually publish anything)" | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
permissions: | ||
# Needed to trigger the publish workflow. | ||
actions: write | ||
|
||
jobs: | ||
|
||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branches: ${{ steps.set_branches.outputs.branches }} | ||
steps: | ||
- name: Convert branches input to JSON array | ||
id: set_branches | ||
run: | | ||
JSON_ARRAY=$(echo "[\"$(echo ${{ inputs.branches }} | tr ' ' '\",\"')\"]") | ||
echo "branches=$JSON_ARRAY" >> "$GITHUB_OUTPUT" | ||
echo "Branches: $JSON_ARRAY" >> "$GITHUB_STEP_SUMMARY" | ||
publish_each: | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
if: ${{ !fromJson(inputs.dry_run) }} | ||
strategy: | ||
# Each job pushes an automated commit to wimods.net@master, so running them all in parallel | ||
# would likely cause conflicts. Also, various servers might hit rate limits if we just upload | ||
# all of the files at once. | ||
max-parallel: 1 | ||
# If something goes wrong, all published files have to be manually deleted. | ||
# Best to fail as early as possible. | ||
fail-fast: true | ||
matrix: | ||
branch: ${{ fromJson(needs.prepare.outputs.branches) }} | ||
# TODO: Maybe also verify that the mod_version in each branch is as expected before publishing? | ||
steps: | ||
- name: Build publish inputs | ||
id: publish_inputs | ||
run: | | ||
JSON_STRING=$(cat << EOF | ||
{ | ||
"close_milestone": "true", | ||
"upload_backups": "true", | ||
"publish_github": "true", | ||
"publish_curseforge": "true", | ||
"publish_modrinth": "true", | ||
"update_website": "true" | ||
} | ||
EOF | ||
) | ||
# Convert to single line and escape quotes | ||
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT" | ||
- name: Trigger publish workflow | ||
id: publish_dispatch | ||
uses: codex-/return-dispatch@v2 | ||
with: | ||
token: ${{ github.token }} | ||
owner: Wurst-Imperium | ||
repo: Mo-Glass | ||
ref: ${{ matrix.branch }} | ||
workflow: publish.yml | ||
workflow_inputs: ${{ steps.publish_inputs.outputs.json }} | ||
- name: Wait for publish workflow to finish (run ${{ steps.publish_dispatch.outputs.run_id }}) | ||
uses: codex-/await-remote-run@v1 | ||
with: | ||
token: ${{ github.token }} | ||
owner: Wurst-Imperium | ||
repo: Mo-Glass | ||
run_id: ${{ steps.publish_dispatch.outputs.run_id }} | ||
run_timeout_seconds: 600 # 10 minutes | ||
|
||
announce: | ||
runs-on: ubuntu-latest | ||
needs: [prepare, publish_each] | ||
if: ${{ !failure() && !cancelled() && inputs.announce_ports }} | ||
steps: | ||
- name: Build announcement inputs | ||
id: announce_inputs | ||
run: | | ||
JSON_STRING=$(cat << EOF | ||
{ | ||
"mod": "mo-glass", | ||
"mod_version": "${{ inputs.mod_version }}", | ||
"branches": "${{ inputs.branches }}", | ||
"dry_run": "${{ inputs.dry_run }}" | ||
} | ||
EOF | ||
) | ||
# Convert to single line and escape quotes | ||
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT" | ||
- name: Trigger announce workflow | ||
id: announce_dispatch | ||
uses: codex-/return-dispatch@v2 | ||
with: | ||
token: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }} | ||
owner: Wurst-Imperium | ||
repo: wimods.net | ||
ref: master | ||
workflow: announce_mod_ports.yml | ||
workflow_inputs: ${{ steps.announce_inputs.outputs.json }} | ||
- name: Wait for announce workflow to finish (run ${{ steps.announce_dispatch.outputs.run_id }}) | ||
uses: codex-/await-remote-run@v1 | ||
with: | ||
token: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }} | ||
owner: Wurst-Imperium | ||
repo: wimods.net | ||
run_id: ${{ steps.announce_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
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