diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml new file mode 100644 index 0000000..e7066b0 --- /dev/null +++ b/.github/workflows/pypi.yaml @@ -0,0 +1,35 @@ +name: Publish package + +on: + workflow_dispatch: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + + - name: Install packages + run: | + python -m pip install build twine + + - name: Build + run: | + python -m build + + - name: Upload to PyPi + if: startsWith(github.ref, 'refs/tags/') + run: | + twine upload dist/* --repository pypi -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} + + - name: Upload to TestPyPi + run: | + twine upload dist/* --repository testpypi -u __token__ -p ${{ secrets.TESTPYPI_API_TOKEN }} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2b797b0..812e7e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,8 @@ authors = [ ] # a license tells other people how to use your code and protects you from stealing license = { text = "MIT" } +# add any packages which your plugin needs in order to run +dependencies = [] [project.urls] # some handy links to help people find your plugin's documentation @@ -26,7 +28,7 @@ docs = [ ] # dependencies for running the test suite tests = [ - "psychopy @ git+https://github.com/psychopy/psychopy@release", + "psychopy", "pytest", ]