Skip to content

Commit

Permalink
Add GH actions to create releases when tags are pushed and deploy whe…
Browse files Browse the repository at this point in the history
…n released.
  • Loading branch information
firilisinof committed Nov 30, 2023
1 parent ef7583a commit 14b3e7f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 23 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
name: Deploy to PyPI

name: Build and deploy with poetry
on:
release:
types: [created]

types: [published]
jobs:
deploy:
build_and_publish:
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@v3

- name: Install poetry with bumpversion plugin
run: |
pipx install poetry
pipx inject poetry poetry-bumpversion
- name: Build the package and bump version
run: |
poetry version ${{ github.ref_name }}
poetry build
- name: Publish to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --repository test-pypi
- uses: actions/checkout@v4

- name: Build and publish to PyPI
uses: JRubics/[email protected]
with:
repository_name: "test-pypi"
repository_url: "https://test.pypi.org/legacy/"
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"
26 changes: 26 additions & 0 deletions .github/workflows/tag-to-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
tags:
- 'v*.*.*'

name: Create releases on tag push

jobs:
build:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This is an automated release.
draft: false
prerelease: false

0 comments on commit 14b3e7f

Please sign in to comment.