diff --git a/.github/workflows/mod-builder.yml b/.github/workflows/mod-builder.yml index 32731be..0eb0683 100644 --- a/.github/workflows/mod-builder.yml +++ b/.github/workflows/mod-builder.yml @@ -52,60 +52,33 @@ jobs: working-directory: ${{ inputs.checkout-directory }} run: ${{ inputs.build-script }} - - name: Delete Latest Release and Tag - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' - uses: dev-drprasad/delete-tag-and-release@v1.0 - with: - delete_release: true - tag_name: "latest" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create Latest Tag + - name: Release Latest if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' working-directory: ${{ inputs.checkout-directory }} run: | + gh release delete latest --cleanup-tag || true git tag -d latest || true + git push --delete origin refs/tags/latest || true git tag latest - git push origin latest - - id: release_latest - name: Release Latest - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' - uses: ncipollo/release-action@v1 - with: - artifactErrorsFailBuild: true - artifacts: ${{ env.DIST_DIR }}/* - generateReleaseNotes: true - makeLatest: true - name: "Latest (unstable)" - prerelease: true - tag: "latest" + git push --force origin refs/tags/latest + gh release create latest "$DIST_DIR"/* \ + --generate-notes \ + --title "Latest (unstable)" \ + --verify-tag \ + --prerelease + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - id: release_tag - name: Release Tag - uses: ncipollo/release-action@v1 + - name: Release Tag if: startsWith(github.ref, 'refs/tags/v') - with: - allowUpdates: true - artifactErrorsFailBuild: true - artifacts: ${{ env.DIST_DIR }}/* - body: ${{ inputs.release-notes }} - draft: false - generateReleaseNotes: true - makeLatest: true - omitBodyDuringUpdate: true - omitDraftDuringUpdate: true - omitNameDuringUpdate: true - omitPrereleaseDuringUpdate: true - - - name: Show release outputs - shell: bash + working-directory: ${{ inputs.checkout-directory }} run: | - echo 'id: ' - echo -n '${{ steps.release_tag.outputs.id }}' - echo -n '${{ steps.release_latest.outputs.id }}' - echo '' - echo '' - echo 'url:' - echo -n '${{ steps.release_tag.outputs.html_url }}' - echo -n '${{ steps.release_latest.outputs.html_url }}' - echo '' + gh release delete "$GITHUB_REF_NAME" || true + gh release create "$GITHUB_REF_NAME" "$DIST_DIR"/* \ + --generate-notes \ + --notes "$RELEASE_NOTES" \ + --verify-tag \ + --latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_NOTES: ${{ inputs.release-notes }}