Skip to content

Commit

Permalink
Separate deploy into its own workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Jan 11, 2024
1 parent ed9c888 commit 666aba3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 29 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: deploy

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:

deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_token }}
- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
31 changes: 2 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
os: "windows-latest"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install tox
Expand All @@ -42,30 +42,3 @@ jobs:
- name: Test
run: |
tox -e ${{ matrix.tox_env }}
deploy:

if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

runs-on: ubuntu-latest

needs: build

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: Install wheel
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}

0 comments on commit 666aba3

Please sign in to comment.