Skip to content

Commit

Permalink
Cruft update (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter committed May 12, 2024
1 parent 73ac864 commit 1f7922e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/allenporter/cookiecutter-python",
"commit": "01be0fce0f141c3e4f80564707a62aa9dab35c21",
"commit": "b658a8560141d0bc0719eaac20d31e8728a1d76c",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,49 @@ name: Upload Python Package

on:
release:
types: [published]
types: [created]

permissions:
contents: read
env:
PYTHON_VERSION: 3.12

jobs:
deploy:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8.14
pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyrainbird
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 1f7922e

Please sign in to comment.