Skip to content

Commit

Permalink
fixup! Add helper script for creating GitHub releases using gh
Browse files Browse the repository at this point in the history
  • Loading branch information
rvem committed Sep 22, 2023
1 parent 6d97271 commit f22aec2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions overlay/github.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
# If 'release-tag' is 'autorelease' or 'PRERELEASE' env variable is set to 'true'
# created release is marked as 'prerelease'.
#
# 'OVERWRITE_RELEASE' env variable is set to 'true' an existing release with 'release-tag'
# will be deleted prior to recreation.
#
# This script expects 'GH_TOKEN' env variable to be set to a GitHub PAT that is capable of
# managing releases in the target repository.
#
# Usage examples:
# autorelease "$(nix build .#release)" "Automatic release on "$(date +\"%Y%m%d%H%M\")""
#
Expand All @@ -25,9 +31,10 @@
release_notes="$2";
release_tag="''${3:-auto-release}"
# gh expects 'GH_TOKEN' env variable to be set
# Delete release if it exists
gh release delete "$release_tag" --yes || true
if [[ ''${OVERWRITE_RELEASE:-false} == true ]]; then
# Delete release if it exists
gh release delete "$release_tag" --yes || true
fi
typeset -a release_args
# Create release
Expand Down

0 comments on commit f22aec2

Please sign in to comment.