diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/release.yml similarity index 70% rename from .github/workflows/pypi-release.yml rename to .github/workflows/release.yml index 7182b37..7f27926 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release to PyPI +name: Release on: release: @@ -7,8 +7,8 @@ on: jobs: release: - # Release to PyPI - name: Release on Pypi + # Release + name: Release runs-on: ubuntu-latest steps: @@ -29,8 +29,8 @@ jobs: python -m pip install --upgrade build python -m pip install --upgrade setuptools wheel twine - # Package and Upload - - name: Package and Upload + # Package and Upload to PyPI + - name: Package and Upload to PyPI env: STACKMANAGER_VERSION: ${{ github.event.release.tag_name }} TWINE_USERNAME: __token__ @@ -38,3 +38,12 @@ jobs: run: | python -m build python -m twine upload dist/* + + # Add Assets to Release on GitHub + - name: Add Assets to Release on GitHub + uses: softprops/action-gh-release@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # The name of the file(s) to upload + files: | + dist/* diff --git a/Makefile b/Makefile index baef0cc..b66f383 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,33 @@ appname = aa-fleetpings appname_verbose = AA Fleet Pings package = fleetpings +translation_template = $(package)/locale/django.pot +git_repository = https://github.com/ppfeufer/$(appname) +git_repository_issues = $(git_repository)/issues # Default goal .DEFAULT_GOAL := help +# Confirm action +.PHONY: confirm-action +confirm-action: + @read -p "Are you sure you want to run '$(MAKECMDGOALS)'? [Y/n] " response; \ + response=$${response:-Y}; \ + if [ "$$response" != "Y" ] && [ "$$response" != "y" ]; then \ + echo "Aborted"; \ + exit 1; \ + fi + +# General confirmation +.PHONY: confirm +confirm: + @read -p "Are you sure? [Y/n] " response; \ + response=$${response:-Y}; \ + if [ "$$response" != "Y" ] && [ "$$response" != "y" ]; then \ + echo "Aborted"; \ + exit 1; \ + fi + # Graph models .PHONY: graph_models graph_models: @@ -26,6 +49,8 @@ prepare-release: graph_models translations @echo "Preparing a release" @read -p "New Version Number: " new_version; \ sed -i "/__version__/c\__version__ = \"$$new_version\"" $(package)/__init__.py; \ + sed -i "/\"Project-Id-Version: /c\\\"Project-Id-Version: $(appname_verbose) $$new_version\\\n\"" $(translation_template); \ + sed -i "/\"Report-Msgid-Bugs-To: /c\\\"Report-Msgid-Bugs-To: $(git_repository_issues)\\\n\"" $(translation_template); \ echo "Updated version in $(TEXT_BOLD)$(package)/__init__.py$(TEXT_BOLD_END)" # Help