From c92b4e70db4d36f638082a4cd47bf95de1c7e124 Mon Sep 17 00:00:00 2001 From: Martin Chase Date: Wed, 26 Mar 2025 12:05:05 -0700 Subject: [PATCH 1/3] put badges in readme --- .github/workflows/deploy.yml | 93 +++++++++++++++++++ .../{python-package-conda.yml => test.yml} | 0 README.md | 4 + 3 files changed, 97 insertions(+) create mode 100644 .github/workflows/deploy.yml rename .github/workflows/{python-package-conda.yml => test.yml} (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..99da6c4d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,93 @@ +name: Publish Python 🐍 distribution 📦 to PyPI + +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/neuroanalysis + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + name: >- + Sign the Python 🐍 distribution 📦 with Sigstore + and upload them to GitHub Release + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v3.0.0 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + '${{ github.ref_name }}' dist/** + --repo '${{ github.repository }}' diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/python-package-conda.yml rename to .github/workflows/test.yml diff --git a/README.md b/README.md index de8f0c65..398c8532 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ Neuroanalysis Modular and interactive tools for analysis of neurophysiology data, with emphasis on patch-clamp electrophysiology. + +[![Tests](https://github.com/AllenInstitute/neuroanalysis/actions/workflows/test.yml/badge.svg)](https://github.com/AllenInstitute/neuroanalysis/actions/workflows/test.yml) +[![PyPI version](https://badge.fury.io/py/neuroanalysis.svg)](https://badge.fury.io/py/neuroanalysis) + * Functions for running common analysis algorithms * Synaptic/calcium event detection and characterization * Synaptic release modeling From acf092aa6f153ed9daef94b33eadc7c4ad44a7bb Mon Sep 17 00:00:00 2001 From: "Martin Chase (aider)" Date: Wed, 26 Mar 2025 12:07:27 -0700 Subject: [PATCH 2/3] ci: Ensure tests run on every push and pull request --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed732c6c..9b07c24b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ name: Python Package using Conda -on: [push] +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "**" ] jobs: build-linux: From 54f897633031d8c5c1b2efc83534562c5f535d78 Mon Sep 17 00:00:00 2001 From: Martin Chase Date: Wed, 26 Mar 2025 12:07:36 -0700 Subject: [PATCH 3/3] ignore aider files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 43e3738d..cae51e4e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ neuroanalysis.egg-info build/ dist/ +.aider*