Skip to content

Commit

Permalink
Merge pull request #26 from lukepolson/auto_pypi
Browse files Browse the repository at this point in the history
Auto pushing to TestPypi
  • Loading branch information
KrisThielemans authored Oct 27, 2024
2 parents f244417 + 668a1e6 commit a7858b3
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish to TestPyPI

on:
workflow_run:
workflows: [CI]
types:
- completed
env:
# Increase this to manually reset the conda environment cache
YARDL_VERSION: 0.6.2

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # Adjust Python version as needed

- name: Install required packages
run: |
pip install setuptools wheel twine build
- name: Install yardl
run: |
YARDL_DIR=${{github.workspace}}/yardl
mkdir ${YARDL_DIR}
cd ${YARDL_DIR}
echo "${{github.workspace}}/yardl" >> $GITHUB_PATH
wget --quiet "https://github.com/microsoft/yardl/releases/download/v${YARDL_VERSION}/yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
tar -xzf "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
rm "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
- name: Run yardl
run: |
cd model
yardl generate
- name: Publish to TestPyPI
run: |
cd python
python -m build
twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u __token__ -p ${{ secrets.TEST_PYPI_TOKEN }}
20 changes: 20 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "petsird"
version = "0.0.1" # Update as needed
description = "Library and tools for working with PET Emission Tomography Standardization Initiative Raw Data (PETSIRD) data"
readme = "README.md"
authors = [{ name = "Kris Thielemans", email = "[email protected]" }]
license = { text = "Apache-2.0" }
requires-python = ">=3.9"
dependencies = [
"numpy>=1.22",
]

[project.urls]
Homepage = "https://etsinitiative.org/"
Repository = "https://github.com/ETSInitiative/PETSIRD.git"
Issues = "https://github.com/ETSInitiative/PETSIRD/issues"

0 comments on commit a7858b3

Please sign in to comment.