Skip to content

Commit 183ba92

Browse files
authored
Workflows (#5)
* Write build workflow * Write release job * Testing * More testing * Fix typo * Update package workflow * I hate workflows * This crap better work * Got workflows working
1 parent aa5cd6b commit 183ba92

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/package.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Python Package
2+
3+
on: [workflow_call]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
package:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.10"
18+
- name: Install Python dependencies
19+
run: |
20+
pip3 install build
21+
- name: Build a binary and a source tarball
22+
run: |
23+
python -m build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: python-package-distributions
28+
path: dist/

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on: [release]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
package:
10+
name: Package
11+
uses: ./.github/workflows/package.yml
12+
13+
release:
14+
name: Release
15+
needs: [package]
16+
runs-on: ubuntu-latest
17+
18+
environment:
19+
name: pypi
20+
url: https://pypi.org/project/py-shr-parser/
21+
22+
permissions:
23+
id-token: write
24+
25+
steps:
26+
- name: Download build artifacts
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
- name: Publish Package to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)