Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Publish to PyPI when releases are created on Github #75

Merged
merged 2 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
release:
types: [ created ]

env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

jobs:
test:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.1.3
- name: Install Dependencies
run: poetry install
- name: Publish to PyPI
run: |
poetry config pypi-token.pypi ${{ PYPI_TOKEN }}
bash scripts/publish.sh
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ lint:

test:
tox

release: clean-build
poetry publish --build
8 changes: 8 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e
set -x

version=$(git describe --tags --abbrev=0)
poetry version "${version}"
poetry publish --build