Skip to content

Commit

Permalink
add release script (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlangbert authored Jan 11, 2025
1 parent 4e4bc3d commit a5e76e7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
release version:
# Ensuring we are on main branch
@git rev-parse --verify main > /dev/null 2>&1 || (echo "Not on main branch" && exit 1)

# Ensuring working directory is clean
@git status --porcelain | grep -q . && (echo "Working directory is not clean (has changes or untracked files)" && exit 1)

# Creating and checking out release preparation branch
@git checkout -b release-prep-{{version}}

# Updating version in manifest.json
@sed -i '' 's/"version": "[^"]*"/"version": "{{version}}"/' custom_components/daikinone/manifest.json

# Comitting version bump
@git commit -am "release: prepare release {{version}}"

# Pushing branch and creating PR
@git push -u origin release-prep-{{version}}
@gh pr create --title "release: prepare {{version}}" --body "Prepare release {{version}}" --base main

# Merging PR
@gh pr merge --auto --delete-branch

# Creating release
@gh release create v{{version}} --generate-notes

0 comments on commit a5e76e7

Please sign in to comment.