Skip to content

Commit

Permalink
use github for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed Sep 16, 2023
1 parent 730f29c commit 8de952f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ CSSFILES = redbot/assets/red_style.css $(MODULES)/google-code-prettify/src/prett
ICONS = solid/check-circle solid/times-circle solid/question-circle solid/exclamation-circle solid/info-circle
ICON_FILES = $(foreach i, $(ICONS),$(MODULES)/@fortawesome/fontawesome-free/svgs/$(i).svg)

YEAR=`date +%Y`
MONTH=`date +%m`

#############################################################################
## Tasks

Expand Down Expand Up @@ -100,17 +103,30 @@ docker: docker-image
.PHONY: version
version: venv
$(eval VERSION=$(shell $(VENV)/python -c "import redbot; print(redbot.__version__)"))
$(eval VER_YEAR=$(shell echo $(VERSION) | cut -d. -f1))
$(eval VER_MONTH=$(shell echo $(VERSION) | cut -d. -f2))
$(eval VER_MICRO=$(shell echo $(VERSION) | cut -d. -f3))
$(eval NEXT_MICRO=$(shell \
if [[ $(YEAR) != $(VER_YEAR) || $(MONTH) != $(VER_MONTH) ]] ; then \
echo "1"; \
else \
echo $$(( $(VER_MICRO) + 1 )); \
fi; \
))

.PHONY: bump-version
bump-version: version
cat redbot/__init__.py | sed -e "s/$(VERSION)/${YEAR}.$(MONTH).$(NEXT_MICRO)/" > redbot/__init__.py

.PHONY: build
build: clean venv
$(VENV)/python -m build

.PHONY: upload
upload: build typecheck test version
git tag redbot-$(VERSION)
.PHONY: release
release: typecheck test version
git tag $(VERSION)
git push
git push --tags origin
$(VENV)/python -m twine upload dist/*
git push --tags origin # github action will push to pypi and create a release there

#############################################################################
## Create new headers
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ importlib_resources
pylint
mypy
types-Markdown
twine
black
playwright
build
Expand Down

0 comments on commit 8de952f

Please sign in to comment.