Skip to content

Commit

Permalink
Set up test and sketch CI publish step
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalrussell committed Mar 11, 2024
1 parent 78752e8 commit 289ee1d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: package

on:
release:
types: [published]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build SDist and wheel
run: pipx run build

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v3
with:
path: dist/*

upload_all:
name: Upload if release
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
# Use the trusted publisher mechanism
# https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
permissions:
id-token: write

steps:
- uses: actions/setup-python@v4

- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
File renamed without changes.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ classifiers = [
[project.urls]
"Homepage" = "https://github.com/nismod/irv-datapkg"
"Bug Tracker" = "https://github.com/nismod/irv-datapkg/issues"

[tool.pytest.ini_options]
testpaths = ["tests"]

0 comments on commit 289ee1d

Please sign in to comment.