From a3fc1165e4c84ffced88170dc80499d8d273517b Mon Sep 17 00:00:00 2001 From: Apex Date: Sat, 29 Oct 2022 23:29:54 +0100 Subject: [PATCH] Update release workflow to fix as many deprecation warnings as possible Still awaiting on the following to fix the final warnings - https://github.com/jimschubert/query-tag-action/issues/4 - https://github.com/Kir-Antipov/mc-publish/issues/39 --- .github/workflows/run_release.yml | 94 +++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 24 deletions(-) diff --git a/.github/workflows/run_release.yml b/.github/workflows/run_release.yml index 819ed03..2e9146a 100644 --- a/.github/workflows/run_release.yml +++ b/.github/workflows/run_release.yml @@ -17,77 +17,112 @@ jobs: outputs: mod_name: ${{ steps.mod_name.outputs.value }} mod_version: ${{ steps.mod_version.outputs.value }} + mod_curseforge_id: ${{ steps.mod_curseforge_id.outputs.value }} + mod_modrinth_id: ${{ steps.mod_modrinth_id.outputs.value }} + mod_release_type: ${{ steps.mod_release_type.outputs.value }} minecraft_version: ${{ steps.minecraft_version.outputs.value }} forge_version: ${{ steps.forge_version.outputs.value }} + tag_current: ${{ steps.tag_current.outputs.tag }} + tag_previous: ${{ steps.tag_previous.outputs.tag }} steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 - name: Unshallow Repository run: git fetch --prune --unshallow - name: Mod Name id: mod_name - uses: christian-draeger/read-properties@1.0.1 + uses: christian-draeger/read-properties@1.1.1 with: path: ./gradle.properties - property: mod_name + properties: mod_name - name: Mod Version id: mod_version - uses: christian-draeger/read-properties@1.0.1 + uses: christian-draeger/read-properties@1.1.1 with: path: ./gradle.properties - property: mod_version + properties: mod_version + + - name: CurseForge ID + id: mod_curseforge_id + uses: christian-draeger/read-properties@1.1.1 + with: + path: ./gradle.properties + properties: mod_curseforge_id + + - name: Modrinth ID + id: mod_modrinth_id + uses: christian-draeger/read-properties@1.1.1 + with: + path: ./gradle.properties + properties: mod_modrinth_id - name: Release Type id: mod_release_type - uses: christian-draeger/read-properties@1.0.1 + uses: christian-draeger/read-properties@1.1.1 with: path: ./gradle.properties - property: mod_release_type + properties: mod_release_type - name: Minecraft Version id: minecraft_version - uses: christian-draeger/read-properties@1.0.1 + uses: christian-draeger/read-properties@1.1.1 with: path: ./gradle.properties - property: minecraft_version + properties: minecraft_version - name: Forge Version id: forge_version - uses: christian-draeger/read-properties@1.0.1 + uses: christian-draeger/read-properties@1.1.1 with: path: ./gradle.properties - property: forge_version + properties: forge_version + + - name: Find Current Tag + id: tag_current + uses: jimschubert/query-tag-action@v2 + with: + include: v* + commit-ish: '@' + skip-unshallow: true + + - name: Find Previous Tag + id: tag_previous + uses: jimschubert/query-tag-action@v2 + with: + include: v* + exclude: ${{ steps.tag_current.outputs.tag }} + skip-unshallow: true - name: View Variables run: | echo "'mod_name': => '${{ steps.mod_name.outputs.value }}'" echo "'mod_version': => '${{ steps.mod_version.outputs.value }}'" + echo "'mod_curseforge_id': => '${{ steps.mod_curseforge_id.outputs.value }}'" + echo "'mod_modrinth_id': => '${{ steps.mod_modrinth_id.outputs.value }}'" + echo "'mod_release_type': => '${{ steps.mod_release_type.outputs.value }}'" echo "'minecraft_version': => '${{ steps.minecraft_version.outputs.value }}'" echo "'forge_version': => '${{ steps.forge_version.outputs.value }}'" - - # Run tests to ensure mod runs fine - tests: - name: Run Project CI Tests - uses: ApexStudios-Dev/.github/.github/workflows/call_tests.yml@master - with: - notification_color: 0x3C40C7 - secrets: - DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }} + echo "'tag_current': => '${{ steps.tag_current.outputs.tag }}'" + echo "'tag_previous': => '${{ steps.tag_previous.outputs.tag }}'" # Generate changelog changelog: name: Generate Changelog uses: ApexStudios-Dev/.github/.github/workflows/call_changelog.yml@master + needs: [ vars ] + with: + tag_current: ${{ needs.vars.outputs.tag_current }} + tag_previous: ${{ needs.vars.outputs.tag_previous }} # Publish jars to various sources compile: name: Compile Project uses: ApexStudios-Dev/.github/.github/workflows/call_compile.yml@master - needs: [ tests ] + needs: [ vars, changelog ] secrets: APEX_MODS_MAVEN_USERNAME: ${{ secrets.APEX_MODS_MAVEN_USERNAME }} APEX_MODS_MAVEN_PASSWORD: ${{ secrets.APEX_MODS_MAVEN_PASSWORD }} @@ -96,7 +131,18 @@ jobs: publish: name: Publish Project uses: ApexStudios-Dev/.github/.github/workflows/call_publish_generic.yml@master - needs: [ compile, changelog ] + needs: [ vars, compile, changelog ] + secrets: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + with: + mod_name: ${{ needs.vars.outputs.mod_name }} + mod_version: ${{ needs.vars.outputs.mod_version }} + mod_curseforge_id: ${{ needs.vars.outputs.mod_curseforge_id }} + mod_modrinth_id: ${{ needs.vars.outputs.mod_modrinth_id }} + mod_release_type: ${{ needs.vars.outputs.mod_release_type }} + minecraft_version: ${{ needs.vars.outputs.minecraft_version }} + tag_current: ${{ needs.vars.outputs.tag_current }} # Dispatch mod publish notifications notify: @@ -108,7 +154,7 @@ jobs: steps: - name: Download Changelog if: ${{ (needs.publish.result == 'success') }} - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: changelog path: .github @@ -162,4 +208,4 @@ jobs: title: '✅️ - **${{ needs.vars.outputs.mod_name }}** - _Published successfully_!' color: 0x3C40C7 username: ApexStudios - avatar_url: https://i.imgur.com/NkQg4yO.png \ No newline at end of file + avatar_url: https://i.imgur.com/NkQg4yO.png