Skip to content

Commit

Permalink
build: add workflow doing PyPI release (#36)
Browse files Browse the repository at this point in the history
* ci: introduce release workflow

* ci: fix yaml syntax in release workflow
  • Loading branch information
skarzi authored Nov 9, 2021
1 parent 7a00967 commit 448b341
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: release
'on':
push:
tags:
- '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: populate dynamic environment variables
run: |
IS_PRERELEASE=true
if [[ "${GITHUB_REF#refs/tags/}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]];
then
IS_PRERELEASE=false
fi
echo "IS_PRERELEASE=${IS_PRERELEASE}" >> ${GITHUB_PATH}
- name: install poetry
run: |
pip install --upgrade pip
INSTALL_POETRY_URL="https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py"
curl \
--silent \
--show-error \
--location "${INSTALL_POETRY_URL}" \
| python
# add `poetry` to `${PATH}`:
echo "${HOME}/.poetry/bin" >> ${GITHUB_PATH}
- name: build project for distribution
run: poetry build
- name: create github release
uses: ncipollo/[email protected]
with:
artifacts: "dist/*"
token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: env.IS_PRERELEASE == 'true'
- name: publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: "${{ secrets.PYPI_TOKEN }}"
run: poetry publish

0 comments on commit 448b341

Please sign in to comment.