Skip to content

Commit

Permalink
update release
Browse files Browse the repository at this point in the history
  • Loading branch information
wasdee committed Oct 7, 2021
1 parent b83afe8 commit eb15421
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,44 @@ on:
- 'v*.*.*'

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get tag
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}

- uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install and configure Poetry
uses: snok/install-poetry@v1.1.1
uses: snok/install-poetry@v1
with:
version: 1.1.4
version: latest
virtualenvs-create: false
virtualenvs-in-project: false

- name: Build project for distribution
run: poetry build

- name: Check Version
id: check-version
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
|| echo ::set-output name=prerelease::true
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: steps.check-version.outputs.prerelease == 'true'

- name: publish to pypi
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
run: poetry publish

0 comments on commit eb15421

Please sign in to comment.