Skip to content

Commit

Permalink
ci: automatically publish on github release (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Feb 12, 2025
1 parent 006e289 commit 6c8df65
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
release:
types: [published]

jobs:
publish-pypi:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
steps:
- name: Checkout actions
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Poetry Config
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Poetry Build
run: poetry build
- name: Poetry Publish
run: poetry publish
28 changes: 0 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
.PHONY: version/patch
version/patch: ## Bump patch version and push to release branch.
@poetry version patch
@make version/commit
@git push origin release/v$$(poetry version -s | sed 's/\.[0-9]*$$//') # Trim the patch version

.PHONY: version/minor
version/minor: ## Bump minor version.
@poetry version minor
@make version/commit

.PHONY: version/major
version/major: ## Bump major version.
@poetry version major
@make version/commit

.PHONY: version/commit
version/commit: ## Commit version bump.
@git add pyproject.toml
@git commit -m "Version bump v$$(poetry version -s)"

.PHONY: publish
publish: ## Push git tag and publish version to PyPI.
@git tag v$$(poetry version -s)
@git push --tags
@poetry build
@poetry publish

.PHONY: install
install: ## Install all dependencies.
@make install/all
Expand Down

0 comments on commit 6c8df65

Please sign in to comment.