Skip to content

Publish all packages to PyPI and release to GitHub #2

Publish all packages to PyPI and release to GitHub

Publish all packages to PyPI and release to GitHub #2

Workflow file for this run

# This publishes to PyPI. See: https://github.com/pypa/gh-action-pypi-publish
name: Publish all packages to PyPI and release to GitHub
on:
workflow_dispatch: null
workflow_call: null
jobs:
docs:
name: publish to PyPI
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install twine wheel build
- name: Build and deploy wheels
env:
PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }}
run: |
dev_tools/update-pypi-version.sh
release:
name: Publish release on GitHub
needs: docs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3 # allows workflow to access repo
- name: Set date for release title
run: echo today=$(date +"%B %d, %Y") >> $GITHUB_ENV # format date and append to env
- name: Set version number to most recent change
run: echo version=$(cat general-superstaq/general_superstaq/_version.py | grep -oP '[0-9\.]+') >> $GITHUB_ENV
- name: Create and publish release
uses: ncipollo/release-action@v1
with:
tag: v${{ env.version }}
commit: ${{ github.sha }}
name: v${{ env.version }} ${{ env.today }} Release
generateReleaseNotes: true
makeLatest: true