diff --git a/.github/scripts/draft-release.sh b/.github/scripts/draft-release.sh new file mode 100755 index 00000000..97fe2a02 --- /dev/null +++ b/.github/scripts/draft-release.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -euo pipefail + +tag=$1 +[ $# -eq 1 ] + +flags=(--draft --fail-on-no-commits --verify-tag) +if [[ "$tag" = v*-rc* ]]; then + flags+=(--prerelease) +fi + +files=( + win64/rgbds-win64.zip + win32/rgbds-win32.zip + macos/rgbds-macos.zip + linux/rgbds-linux-x86_64.tar.xz + rgbds-source.tar.gz +) + +set -x +gh release create "${flags[@]}" --notes-file - "$tag" "${files[@]}" <<"EOF" +Please ensure that the packages below work properly. +Once that's done, replace this text with the changelog, un-draft the release, and update the `release` branch. +By the way, if you forgot to update `include/version.hpp`, RGBASM's version test is going to fail in the tag's regression testing! (Use `git push --delete origin ` to delete it) +EOF diff --git a/.github/workflows/create-release-artifacts.yml b/.github/workflows/create-release-artifacts.yml index 8a800eb5..23af3ad5 100644 --- a/.github/workflows/create-release-artifacts.yml +++ b/.github/workflows/create-release-artifacts.yml @@ -113,24 +113,11 @@ jobs: - name: Package sources run: | make dist Q= - ls - - name: Download Linux binaries + - name: Download all binary packages uses: actions/download-artifact@v8 - - name: Release - uses: softprops/action-gh-release@v2 - with: - body: | - Please ensure that the packages below work properly. - Once that's done, replace this text with the changelog, un-draft the release, and update the `release` branch. - By the way, if you forgot to update `include/version.hpp`, RGBASM's version test is going to fail in the tag's regression testing! (Use `git push --delete origin ` to delete it) - draft: true # Don't publish the release quite yet... - prerelease: ${{ contains(github.ref, '-rc') }} - files: | - win32/rgbds-win32.zip - win64/rgbds-win64.zip - macos/rgbds-macos.zip - linux/rgbds-linux-x86_64.tar.xz - rgbds-source.tar.gz - fail_on_unmatched_files: true + - name: Draft the release + run: | + .github/scripts/draft-release.sh "${ref#refs/tags/}" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.ref_name }} + GH_TOKEN: ${{ github.token }} # Required by the `gh` command.