Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Python Package

on: [workflow_call]

permissions:
contents: read

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python dependencies
run: |
pip3 install build
- name: Build a binary and a source tarball
run: |
python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on: [release]

permissions:
contents: read

jobs:
package:
name: Package
uses: ./.github/workflows/package.yml

release:
name: Release
needs: [package]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/project/py-shr-parser/

permissions:
id-token: write

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

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