diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..485567d --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,79 @@ +name: Release Please + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + +# cancel in-progress runs that use the same workflow and branch +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + release-please: + name: Create Release PRs + runs-on: ubuntu-latest + # Only run release-please on pushes to main, not on PRs + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + permissions: + contents: write + issues: write + pull-requests: write + steps: + # Generate token using your organization's GitHub App + - name: Generate token + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.GH_ACTIONS_HELPER_APP_ID }} + private-key: ${{ secrets.GH_ACTIONS_HELPER_PK }} + + - name: Release Please + uses: googleapis/release-please-action@v4 + id: release + with: + manifest-file: ".release-please-manifest.json" + config-file: "release-please-config.json" + target-branch: "main" + token: ${{ steps.generate_token.outputs.token }} # ← Changed from secrets.GITHUB_TOKEN + outputs: + paths_released: ${{ steps.release.outputs.paths_released }} + release_created: ${{ steps.release.outputs.release_created }} + + publish-pypi: + name: Build and publish to PyPI + runs-on: ubuntu-latest + needs: release-please + # Only publish when a release is actually created + if: needs.release-please.outputs.release_created == 'true' + environment: + name: pypi + url: https://pypi.org/p/slabpick # ← Make sure this matches your PyPI package name + permissions: + id-token: write # Required for trusted publishing + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build dependen + run: | + python -m pip install -U pip + python -m pip install build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..362a783 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "1.0.0" +} + diff --git a/README.md b/README.md index 3fc80fd..f940484 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ curated in CryoSPARC or by Relion's 2D class averaging routine are also included ## Instructions for use +### Slabpick with CryoSPARC + The `make_minislabs` command will generate either galleries (per-particle projections tiled into mock micrographs) for use in CryoSPARC or particle stacks for use in Relion. @@ -23,4 +25,6 @@ cs_center_picks —cs_file /path/to/picked_particles.cs —map_file path/to/gall 4. After 2D classification, particles can be mapped back to a copick project or a Relion-4 starfile using the `cs_map_particles` command. -Details for use in Relion to follow. \ No newline at end of file +### Slabpick with RELION + +Refer to the [Documentation](https://chanzuckerberg.github.io/py2rely/user-guide/2d-slab-classification/) for details \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 90055d9..8d9d082 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,7 @@ classifiers = [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", ] -#dynamic = ["version"] -version = "0.1.0" +dynamic = ["version"] dependencies = [ "copick", "pydantic", @@ -32,6 +31,9 @@ readme = "README.md" license = {file = "LICENSE"} keywords = ["cryoet", "cryo-et", "tomography"] +[tool.hatch.version] +path = "src/slabpick/__init__.py" + [project.urls] Repository = "https://github.com/slabpick/slabpick.git" Issues = "https://github.com/slabpick/slabpick/issues" diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..bf609f0 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,28 @@ +{ + "release-type": "python", + "changelog-sections": [ + { "type": "feat", "section": "✨ Features" }, + { "type": "fix", "section": "🐞 Bug Fixes" }, + { "type": "perf", "section": "⚡️ Performance Improvements" }, + { "type": "revert", "section": "↩️ Reverts" }, + { "type": "docs", "section": "📝 Documentation" }, + { "type": "style", "section": "💅 Styles" }, + { "type": "chore", "section": "🧹 Miscellaneous Chores" }, + { "type": "refactor", "section": "♻️ Code Refactoring" }, + { "type": "test", "section": "🧪 Tests" }, + { "type": "build", "section": "🛠️ Build System" }, + { "type": "ci", "section": "⚙ Continuous Integration" } + ], + "packages": { + ".": { + "package-name": "slabpick", + "version-file": "slabpick/__init__.py", + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": false, + "bump-patch-for-minor-pre-major": false, + "draft": false, + "prerelease": false, + "pull-request-footer": "Slabpick on PyPI." + } + } +} diff --git a/src/slabpick/__init__.py b/src/slabpick/__init__.py index e69de29..d538f87 100644 --- a/src/slabpick/__init__.py +++ b/src/slabpick/__init__.py @@ -0,0 +1 @@ +__version__ = "1.0.0" \ No newline at end of file