Skip to content

Commit

Permalink
add release and prerelease actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Jul 28, 2023
1 parent cca5d9c commit e3a5eea
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: TestPyPI

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+'

env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
TWINE_REPOSITORY_URL: 'https://test.pypi.org/legacy/'

jobs:
build-and-publish:
name: Build and publish to TestPyPI
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install twine
run: |
pip install --upgrade pip wheel setuptools
pip install twine
python --version
pip --version
twine --version
- name: Create source distribution
run: |
python setup.py sdist --dist-dir wheelhouse
- name: Upload source distribution
run: |
twine upload --skip-existing wheelhouse/*.tar.gz
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PyPI

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '!v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+'

env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install twine
run: |
pip install --upgrade pip wheel setuptools
pip install twine
python --version
pip --version
twine --version
- name: Create source distribution
run: |
python setup.py sdist --dist-dir wheelhouse
- name: Upload source distribution
run: |
twine upload --skip-existing wheelhouse/*.tar.gz

0 comments on commit e3a5eea

Please sign in to comment.