|
| 1 | +name: 'Call: Platform Uploads' |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + target_tag: |
| 7 | + description: 'Version to upload' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + upload_modrinth: |
| 11 | + description: 'Upload to modrinth.com' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + upload_dbo: |
| 15 | + description: 'Upload to dev.bukkit.org' |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + secrets: |
| 19 | + MODRINTH_TOKEN: |
| 20 | + required: true |
| 21 | + DBO_UPLOAD_API_TOKEN: |
| 22 | + required: true |
| 23 | + |
| 24 | +jobs: |
| 25 | + platform_uploads: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - name: Get release info |
| 29 | + id: release-info |
| 30 | + uses: cardinalby/[email protected] |
| 31 | + env: |
| 32 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + with: |
| 34 | + tag: ${{ inputs.target_tag }} |
| 35 | + |
| 36 | + - name: Download release artifact |
| 37 | + id: release-artifact |
| 38 | + |
| 39 | + with: |
| 40 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + version: tags/${{ steps.release-info.outputs.tag_name }} |
| 42 | + file: multiverse-core-${{ steps.release-info.outputs.tag_name }}.jar |
| 43 | + |
| 44 | + - name: Parse release type |
| 45 | + run: | |
| 46 | + if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then |
| 47 | + echo Setting RELEASE_TYPE to Beta |
| 48 | + echo "RELEASE_TYPE=Beta" >> $GITHUB_ENV |
| 49 | + else |
| 50 | + echo Setting RELEASE_TYPE to Release |
| 51 | + echo "RELEASE_TYPE=Release" >> $GITHUB_ENV |
| 52 | + fi |
| 53 | +
|
| 54 | + - name: echo inputs |
| 55 | + run: | |
| 56 | + echo "upload_modrinth: ${{ inputs.upload_modrinth }}" |
| 57 | + echo "upload_dbo: ${{ inputs.upload_dbo }}" |
| 58 | + echo "RELEASE_TYPE: ${{ env.RELEASE_TYPE }}" |
| 59 | +
|
| 60 | + - name: Upload to Modrinth |
| 61 | + if: inputs.upload_modrinth == 'true' |
| 62 | + uses: benwoo1110/[email protected] |
| 63 | + with: |
| 64 | + api_token: ${{ secrets.MODRINTH_TOKEN }} |
| 65 | + project_id: 3wmN97b8 |
| 66 | + version_number: ${{ steps.release-info.outputs.tag_name }} |
| 67 | + files: '["${{ github.workspace }}/multiverse-core-${{ steps.release-info.outputs.tag_name }}.jar"]' |
| 68 | + name: ${{ steps.release-info.outputs.tag_name }} |
| 69 | + changelog: ${{ steps.release-artifact.outputs.body }} |
| 70 | + game_versions: 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13 |
| 71 | + version_type: ${{ env.RELEASE_TYPE }} |
| 72 | + loaders: bukkit, spigot, paper |
| 73 | + |
| 74 | + - name: Upload to DBO |
| 75 | + if: inputs.upload_dbo == 'true' |
| 76 | + uses: benwoo1110/[email protected] |
| 77 | + with: |
| 78 | + api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }} |
| 79 | + project_id: 30765 |
| 80 | + changelog: ${{ steps.release-artifact.outputs.body }} |
| 81 | + changelog_type: markdown |
| 82 | + display_name: ${{ steps.release-info.outputs.tag_name }} |
| 83 | + game_versions: 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17, 1.16, 1.15, 1.14, 1.13 |
| 84 | + release_type: ${{ env.RELEASE_TYPE }} |
| 85 | + project_relations: > |
| 86 | + [ |
| 87 | + {"slug": "multiverse-portals", "type": "optionalDependency"}, |
| 88 | + {"slug": "multiverse-netherportals", "type": "optionalDependency"}, |
| 89 | + {"slug": "multiverse-signportals", "type": "optionalDependency"}, |
| 90 | + {"slug": "multiverse-inventories", "type": "optionalDependency"} |
| 91 | + ] |
| 92 | + file_path: ${{ github.workspace }}/multiverse-core-${{ steps.release-info.outputs.tag_name }}.jar |
0 commit comments