Skip to content

Commit

Permalink
Publish to PyPI via AutoPub and GitHub Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer committed Aug 21, 2020
1 parent c7bbd56 commit 1114ce0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,35 @@ jobs:
poetry install
- name: Run linters
run: poetry run invoke lint


deploy:
name: Deploy
needs: [test, lint]
runs-on: ubuntu-latest
if: ${{ github.ref=='refs/heads/master' && github.event_name!='pull_request' }}

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Check release
id: check_release
run: |
python -m pip install -U pip
python -m pip install poetry githubrelease autopub
echo "##[set-output name=release;]$(autopub check)"
- name: Publish
if: ${{ steps.check_release.outputs.release=='' }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
git remote set-url origin https://$GITHUB_TOKEN@github.com/${{ github.repository }}
autopub prepare
poetry build
autopub commit
autopub githubrelease
poetry publish -u __token__ -p $PYPI_PASSWORD
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ Werkzeug = "^1.0"
[tool.poetry.extras]
markdown = ["markdown"]

[tool.autopub]
project-name = "SEO"
git-username = "botpub"
git-email = "botpub@autopub.rocks"

[tool.isort]
# Maintain compatibility with Black
combine_as_imports = true
Expand Down

0 comments on commit 1114ce0

Please sign in to comment.