Skip to content

Commit 9fe7a5d

Browse files
committed
Fix release workflow task grouping
1 parent a43135d commit 9fe7a5d

1 file changed

Lines changed: 23 additions & 43 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -114,66 +114,46 @@ jobs:
114114
!common/**
115115
116116
# Publish artifacts, continuing on error. Incurs reconfiguration overhead.
117-
- name: NeoForge GitHub
118-
id: neoforge_github
117+
- name: GitHub
118+
id: github
119119
shell: bash
120-
if: inputs.neoforge && inputs.github
120+
if: inputs.github && (inputs.fabric || inputs.neoforge)
121121
continue-on-error: true
122122
env:
123123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124-
run: ./gradlew neoforge:publishGithub --stacktrace
125-
- name: NeoForge Modrinth
126-
id: neoforge_modrinth
127-
shell: bash
128-
if: inputs.neoforge && inputs.modrinth
129-
continue-on-error: true
130-
env:
131-
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
132-
run: ./gradlew neoforge:publishModrinth --stacktrace
133-
- name: NeoForge CurseForge
134-
id: neoforge_curseforge
135-
shell: bash
136-
if: inputs.neoforge && inputs.curseforge
137-
continue-on-error: true
138-
env:
139-
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
140-
run: ./gradlew neoforge:publishCurseforge --stacktrace
141-
- name: Fabric GitHub
142-
id: fabric_github
143-
shell: bash
144-
if: inputs.fabric && inputs.github
145-
continue-on-error: true
146-
env:
147-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148-
run: ./gradlew fabric:publishGithub --stacktrace
149-
- name: Fabric Modrinth
150-
id: fabric_modrinth
124+
FABRIC_TASK: ${{ inputs.fabric && 'fabric:publishGithub' || '' }}
125+
NEOFORGE_TASK: ${{ inputs.neoforge && 'neoforge:publishGithub' || '' }}
126+
run: ./gradlew $FABRIC_TASK $NEOFORGE_TASK --stacktrace
127+
128+
- name: Modrinth
129+
id: modrinth
151130
shell: bash
152-
if: inputs.fabric && inputs.modrinth
131+
if: inputs.modrinth && (inputs.fabric || inputs.neoforge)
153132
continue-on-error: true
154133
env:
155134
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
156-
run: ./gradlew fabric:publishModrinth --stacktrace
157-
- name: Fabric CurseForge
158-
id: fabric_curseforge
135+
FABRIC_TASK: ${{ inputs.fabric && 'fabric:publishModrinth' || '' }}
136+
NEOFORGE_TASK: ${{ inputs.neoforge && 'neoforge:publishModrinth' || '' }}
137+
run: ./gradlew $FABRIC_TASK $NEOFORGE_TASK --stacktrace
138+
139+
- name: CurseForge
140+
id: curseforge
159141
shell: bash
160-
if: inputs.fabric && inputs.curseforge
142+
if: inputs.curseforge && (inputs.fabric || inputs.neoforge)
161143
continue-on-error: true
162144
env:
163145
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
164-
run: ./gradlew fabric:publishCurseforge --stacktrace
146+
FABRIC_TASK: ${{ inputs.fabric && 'fabric:publishCurseforge' || '' }}
147+
NEOFORGE_TASK: ${{ inputs.neoforge && 'neoforge:publishCurseforge' || '' }}
148+
run: ./gradlew $FABRIC_TASK $NEOFORGE_TASK --stacktrace
165149

166150
# Finally, check for publishing errors and fail the task if one was found.
167151
- name: Check publishing errors
168152
shell: bash
169153
if: |
170-
steps.neoforge_github.outcome == 'failure' ||
171-
steps.neoforge_modrinth.outcome == 'failure' ||
172-
steps.neoforge_curseforge.outcome == 'failure' ||
173-
steps.fabric_github.outcome == 'failure' ||
174-
steps.fabric_modrinth.outcome == 'failure' ||
175-
steps.fabric_curseforge.outcome == 'failure'
154+
steps.github.outcome == 'failure'
155+
|| steps.modrinth.outcome == 'failure'
156+
|| steps.curseforge.outcome == 'failure'
176157
run: |
177158
echo "Detected an error in a publish task: check the Summary for details"
178159
exit 1
179-

0 commit comments

Comments
 (0)