Skip to content

0.0.7

0.0.7 #18

Workflow file for this run

name: publish
on:
release:
types:
- prereleased
- released
permissions:
contents: read
jobs:
build:
name: Build distribution πŸ“¦
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: Build Distribution
run: python -m build
- name: Upload Windows Dists
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
- name: Test list pre-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release list
pypi-publish:
name: Publish Python 🐍 distribution πŸ“¦ to PyPI
runs-on: ubuntu-latest
if: github.event.action == 'released' && startsWith(github.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/sqlplate/
needs:
- build
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- run: |
echo "github ref is:" ${{ github.ref }}
echo "event name is:" ${{ github.event_name }}
echo "event type is:" ${{ github.event.action }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
testpypi-publish:
name: Publish Python 🐍 distribution πŸ“¦ to TestPyPI
runs-on: ubuntu-latest
if: github.event.action == 'prereleased' && startsWith(github.ref, 'refs/tags')
environment:
name: testpypi
url: https://test.pypi.org/p/sqlplate/
needs:
- build
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- run: |
echo "github ref is:" ${{ github.ref }}
echo "event name is:" ${{ github.event_name }}
echo "event type is:" ${{ github.event.action }}
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
repository-url: ${{ vars.PYPI_REPO_URL }}
skip-existing: true
verbose: true
github-release:
name: >-
Sign the Python 🐍 distribution πŸ“¦ with Sigstore
and upload them to GitHub Release
runs-on: ubuntu-latest
needs:
- pypi-publish
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- uses: actions/checkout@v4
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: |
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.event.release.tag_name }}" dist/**