Skip to content

Commit

Permalink
#134 Cleanup - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Dec 3, 2024
1 parent f94979f commit 5a05d51
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 1 deletion.
89 changes: 89 additions & 0 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Publish to pypi

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

permissions:
contents: read

jobs:
build-distribution:
name: Build distribution
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Install pypa/build
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install build
- 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-distribution
environment:
name: pypi
url: https://pypi.org/p/senzing-core
permissions:
id-token: write
runs-on: ubuntu-latest

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: Sign the Python distribution with Sigstore and upload them to GitHub Release
needs:
- publish-to-pypi
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
runs-on: ubuntu-latest

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = senzing_core
version = 0.3.0
author = senzing
author_email = [email protected]
description = Python SDK for Senzing API
description = Senzing Python SDK
license = Apache 2
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 5a05d51

Please sign in to comment.