Skip to content

Commit

Permalink
chore(ci): automate release
Browse files Browse the repository at this point in the history
  • Loading branch information
gciatto committed May 5, 2024
1 parent 27de028 commit c6eeaac
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,41 @@ jobs:
- name: Test
shell: bash
run: poetry run python -m unittest discover -v -s tests

release:
needs: test
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
name: Release on PyPI and GitHub
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install poetry
run: pip install poetry

- name: Restore Python dependencies
run: poetry install

- name: Bump version
shell: bash
run: poetry run python bump_version.py --apply | tee CHANGELOG.md

- name: Build Python Package
run: poetry build

- name: Publish on TestPyPI
run: poetry publish --repository pypi-test --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }}

- name: Create GitHub Release
shell: bash
run: |
RELEASE_TAG=$(poetry version --short)
gh release create $RELEASE_TAG dist/* -t v$RELEASE_TAG -F CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c6eeaac

Please sign in to comment.