-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor GitHub workflows and Makefile for version release.
- Remove unnecessary targets from Makefile - Add new `release-version` target for releasing versions - Improve version retrieval in `__init__.py` - Delete unused GitHub workflow files - Add new GitHub workflow for publishing with tag triggers - Simplify and update permissions in release workflow - Update release-drafter template for clarity
- Loading branch information
Showing
8 changed files
with
45 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ version-resolver: | |
- 'patch' | ||
default: patch | ||
template: | | ||
## Changes | ||
## What's Changed | ||
$CHANGES |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
VERSION: ${{ github.ref_name }} | ||
|
||
steps: | ||
- run: make publish-package | ||
- run: make publish-image |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,57 +52,6 @@ build: | |
build-image: | ||
docker compose build | ||
|
||
release-major: | ||
$(eval VERSION=$(shell echo "$(LATEST_TAG)" | awk -F'.' '{printf "%d.0.0", $$1 + 1}')) | ||
ifdef CI | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
endif | ||
sed -i '' "s/__version__ = '.*'/__version__ = '$(VERSION)'/g" transcribe_me/__init__.py | ||
git add transcribe_me/__init__.py | ||
git commit -m "chore: Bump version to $(VERSION)" | ||
git tag -a "v$(VERSION)" | ||
git push origin main | ||
git push --tags | ||
git branch --force -D release/$(VERSION) | ||
git checkout -b release/$(VERSION) | ||
git push --set-upstream origin release/$(VERSION) | ||
|
||
release-minor: | ||
$(eval VERSION=$(shell echo "$(LATEST_TAG)" | awk -F'.' '{printf "%d.%d.0", $$1, $$2 + 1}')) | ||
ifdef CI | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
endif | ||
sed -i '' "s/__version__ = '.*'/__version__ = '$(VERSION)'/g" transcribe_me/__init__.py | ||
git add transcribe_me/__init__.py | ||
git commit -m "chore: Bump version to $(VERSION)" | ||
git tag -a "v$(VERSION)" | ||
git push origin main | ||
git push --tags | ||
git branch --force -D release/$(VERSION) | ||
git checkout -b release/$(VERSION) | ||
git push --set-upstream origin release/$(VERSION) | ||
|
||
release-patch: | ||
$(eval VERSION=$(shell echo "$(LATEST_TAG)" | awk -F'.' '{printf "%d.%d.%d", $$1, $$2, $$3 + 1}')) | ||
ifdef CI | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
endif | ||
sed -i '' "s/__version__ = '.*'/__version__ = '$(VERSION)'/g" transcribe_me/__init__.py | ||
git add transcribe_me/__init__.py | ||
git commit -m "chore: Bump version to $(VERSION)" | ||
git tag -a "v$(VERSION)" | ||
git push origin main | ||
git push --tags | ||
git branch --force -D release/$(VERSION) | ||
git checkout -b release/$(VERSION) | ||
git push --set-upstream origin release/$(VERSION) | ||
|
||
gh-publish-image: | ||
gh workflow view prerelease.yaml --web | ||
|
||
publish-package: | ||
rm -rdf dist | ||
$(MAKE) build | ||
|
@@ -122,4 +71,13 @@ transcribe-archive: install | |
$(VENV) python -m transcribe_me.main archive | ||
|
||
transcribe-install: install | ||
$(VENV) python -m transcribe_me.main install | ||
$(VENV) python -m transcribe_me.main install | ||
|
||
release-version: | ||
ifdef CI | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
endif | ||
git tag -a "v$(VERSION)" | ||
git push origin main | ||
git push --tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
__version__ = '0.5.0' | ||
import os | ||
|
||
__version__ = os.environ.get("VERSION") | ||
|
||
if __version__ is None: | ||
print("Error: VERSION environment variable is not set.") | ||
exit(1) |