Skip to content

Commit

Permalink
feat(ci): adding publish to pypi action (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
shirshanka authored Apr 26, 2022
1 parent d045345 commit e31ef6b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: pypi-release
on:
release:
types: [published]

jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compute Tag
id: tag
run: |
echo "GITHUB_REF: $GITHUB_REF"
SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")
TAG=$(echo ${GITHUB_REF} | sed -e 's,refs/tags/v,,g')
echo "tag=$TAG"
echo "::set-output name=tag::$TAG"
push_to_pypi:
name: Build and push python package to PyPI
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
RELEASE_VERSION=${{ needs.setup.outputs.tag }} ./scripts/release.sh

0 comments on commit e31ef6b

Please sign in to comment.