File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 inputs :
77 mod_version :
88 description : " Mod version (without v or -MC)"
9- required : true
109 type : string
10+ required : true
1111 branches :
1212 description : " Space-separated list of branches to publish from"
13- required : true
1413 type : string
14+ required : true
1515 publish_curseforge :
1616 description : " Publish to CurseForge"
17- required : true
1817 type : boolean
1918 default : true
2019 announce_update :
2120 description : " Announce as an update on WurstForum"
22- required : true
2321 type : boolean
2422 default : false
2523 announce_ports :
2624 description : " Announce as ports on WurstForum"
27- required : true
2825 type : boolean
2926 default : false
3027 dry_run :
3128 description : " Dry-run mode (don't actually publish anything)"
32- required : false
3329 type : boolean
3430 default : false
3531
5248 JSON_ARRAY="[${quoted_branches%,}]"
5349 echo "branches=$JSON_ARRAY" >> "$GITHUB_OUTPUT"
5450 echo "Branches: $JSON_ARRAY" >> "$GITHUB_STEP_SUMMARY"
51+ - name : Verify mod_version is as expected
52+ run : |
53+ expected_prefix="${{ inputs.mod_version }}-MC"
54+ for branch in ${{ inputs.branches }}; do
55+ url="https://raw.githubusercontent.com/${{ github.repository }}/${branch}/gradle.properties"
56+ actual=$(curl -sf "$url" | grep "^mod_version=" | cut -d'=' -f2)
57+ echo "$branch: $actual"
58+ [[ "$actual" == "$expected_prefix"* ]] || { echo "::error::Expected $expected_prefix*, got $actual"; exit 1; }
59+ done
5560
5661 publish_each :
5762 runs-on : ubuntu-latest
6772 fail-fast : true
6873 matrix :
6974 branch : ${{ fromJson(needs.prepare.outputs.branches) }}
70- # TODO: Maybe also verify that the mod_version in each branch is as expected before publishing?
7175 steps :
7276 - name : Trigger publish workflow
7377 uses : Wurst-Imperium/dispatch-and-wait@v1
Original file line number Diff line number Diff line change 66 inputs :
77 close_milestone :
88 description : " Close milestone"
9- required : true
109 type : boolean
1110 default : true
1211 upload_backups :
1312 description : " Upload to backups server"
14- required : true
1513 type : boolean
1614 default : true
1715 publish_github :
1816 description : " Publish to GitHub"
19- required : true
2017 type : boolean
2118 default : true
2219 publish_curseforge :
2320 description : " Publish to CurseForge"
24- required : true
2521 type : boolean
2622 default : true
2723 update_website :
2824 description : " Update wimods.net post (only works if there already is one)"
29- required : false
3025 type : boolean
3126 default : false
3227 distinct_id :
28+ type : string
3329 required : false
3430
3531permissions :
7470 run : ./gradlew build --stacktrace
7571
7672 - name : Create and push tag
73+ if : ${{ github.ref_type != 'tag' }}
7774 run : |
7875 MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
7976 git config --global user.name "Wurst-Bot"
@@ -140,6 +137,7 @@ jobs:
140137 "mod_version": "${{ steps.website_inputs.outputs.mod_version }}",
141138 "mc_version": "${{ steps.website_inputs.outputs.mc_version }}",
142139 "fapi_version": "${{ steps.website_inputs.outputs.fapi_version }}",
143- "file_id": "${{ steps.cf_file_id.outputs.file_id }}"
140+ "file_id": "${{ steps.cf_file_id.outputs.file_id }}",
141+ "modrinth": "false"
144142 }
145143 run_timeout_seconds : 600 # 10 minutes
You can’t perform that action at this time.
0 commit comments