Skip to content

Commit

Permalink
Merge pull request #143 from numtide/release-script
Browse files Browse the repository at this point in the history
add release script
  • Loading branch information
Mic92 authored Nov 5, 2024
2 parents cbd5497 + 1a6c594 commit de29c3e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions scripts/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

set -eu -o pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$SCRIPT_DIR/.."

version=${1:-}
if [[ -z $version ]]; then
echo "USAGE: $0 version" >&2
exit 1
fi

if [[ "$(git symbolic-ref --short HEAD)" != "main" ]]; then
echo "must be on master branch" >&2
exit 1
fi

# ensure we are up-to-date
uncommitted_changes=$(git diff --compact-summary)
if [[ -n $uncommitted_changes ]]; then
echo -e "There are uncommitted changes, exiting:\n${uncommitted_changes}" >&2
exit 1
fi
git pull [email protected]:numtide/nixos-facter main
unpushed_commits=$(git log --format=oneline origin/main..main)
if [[ $unpushed_commits != "" ]]; then
echo -e "\nThere are unpushed changes, exiting:\n$unpushed_commits" >&2
exit 1
fi
nix flake check -vL
git tag "${version}"

echo "now run 'git push --tags origin master'"

0 comments on commit de29c3e

Please sign in to comment.