diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c723700..2071548 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,8 +103,19 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + # A release made by hand on GitHub (which also makes the tag) gets + # the files; its title, notes and pre-release mark stay as they are. + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then + gh release upload "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" --clobber + exit 0 + fi # A tag with a suffix (v1.2.0-rc1) is a pre-release. pre=() case "$GITHUB_REF_NAME" in *-*) pre=(--prerelease) ;; esac - gh release create "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" \ - --title "Squirrel ${GITHUB_REF_NAME#v}" --generate-notes "${pre[@]}" + if ! gh release create "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" \ + --title "Squirrel ${GITHUB_REF_NAME#v}" --generate-notes "${pre[@]}"; then + # Made meanwhile (another run, or by hand): fill that one. Any + # other failure stays a failure. + gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1 || exit 1 + gh release upload "$GITHUB_REF_NAME" out/* --repo "$GITHUB_REPOSITORY" --clobber + fi diff --git a/README.md b/README.md index a3d7e74..a46cf13 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ git tag v0.16.0 git push origin v0.16.0 ``` -The release workflow then builds squirreld for every board, Squirrel Maker as a Mac app and as a command line program (with the packages a new card needs), and publishes them with their SHA-256 checksums as a GitHub release. A tag with a suffix, such as `v0.16.0-rc1`, becomes a pre-release. +The release workflow then builds squirreld for every board, Squirrel Maker for macOS and Windows (with the packages a new card needs), and publishes them with their SHA-256 checksums as a GitHub release. A tag with a suffix, such as `v0.16.0-rc1`, becomes a pre-release. A release made by hand on GitHub also makes the tag; the workflow then adds the files to it and leaves its title, notes and pre-release mark alone. Dependabot proposes newer Go modules and GitHub Actions once a week, as a pull request that CI tests.