Skip to content

Commit

Permalink
Merge pull request #559 from openmeterio/release
Browse files Browse the repository at this point in the history
chore: add release script
  • Loading branch information
sagikazarmark authored Jan 24, 2024
2 parents 2f28e7d + 071dc8f commit 84839b5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest-large

permissions:
contents: read
contents: write
packages: write
id-token: write
security-events: write
Expand Down
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@

# python
poetry

just
semver-tool
] ++ [
self'.packages.licensei
inputs'.dagger.packages.dagger
Expand Down
25 changes: 25 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
release:
#!/usr/bin/env bash
set -euo pipefail
git checkout main > /dev/null 2>&1
git diff-index --quiet HEAD || (echo "Git directory is dirty" && exit 1)

version=v$(semver bump prerelease beta.. $(git describe --abbrev=0))

echo "Detected version: ${version}"
read -n 1 -p "Is that correct (y/N)? " answer
echo

case ${answer:0:1} in
y|Y )
echo "Tagging release with version ${version}"
;;
* )
echo "Aborting"
exit 1
;;
esac

git tag -m "Release ${version}" $version
git push origin $version

0 comments on commit 84839b5

Please sign in to comment.