Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,32 @@ jobs:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
- name: Setup Conda
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4
with:
python-version: "3.14"
miniforge-variant: Miniforge3
auto-activate: true
activate-environment: base
conda-remove-defaults: true
channels: conda-forge,bioconda
channel-priority: strict

- name: Install testing dependencies
- name: Install conda-build
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[testing]'
conda install -y \
--override-channels \
-c conda-forge \
conda-build

- name: Run regression tests
- name: Build and run regression tests
shell: bash -l {0}
run: |
python -m pytest tests \
-m regression \
-vv \
--durations=20 \
--basetemp=.testdata

- name: Upload regression artefacts on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: pr-regression-failure
path: .testdata/
if-no-files-found: ignore
include-hidden-files: true
retention-days: 7
conda build conda-recipe \
--override-channels \
-c conda-forge \
-c bioconda \
--no-anaconda-upload

docs:
name: Docs
Expand Down
45 changes: 22 additions & 23 deletions .github/workflows/regression-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,29 @@ jobs:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
- name: Setup Conda
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4
with:
python-version: "3.14"

- name: Install testing dependencies
miniforge-variant: Miniforge3
auto-activate: true
activate-environment: base
conda-remove-defaults: true
channels: conda-forge,bioconda
channel-priority: strict

- name: Install conda-build
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[testing]'
conda install -y \
--override-channels \
-c conda-forge \
conda-build

- name: Run regression tests
- name: Build and run regression tests
shell: bash -l {0}
run: |
python -m pytest tests \
-m regression \
-vv \
--durations=20 \
--basetemp=.testdata

- name: Upload regression artefacts on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sist-regression-failure
path: .testdata/
if-no-files-found: ignore
include-hidden-files: true
retention-days: 7
conda build conda-recipe \
--override-channels \
-c conda-forge \
-c bioconda \
--no-anaconda-upload
229 changes: 229 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
name: Release SIST

on:
workflow_dispatch:
inputs:
version:
required: true
default: 'x.y.z'

permissions:
contents: write
pull-requests: write

jobs:
checks:
name: Version check
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
id: repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.14.6

- name: Get latest release
id: latestreleased
run: |
PREVIOUS_VERSION=$(git tag --sort=-v:refname | head -n 1)
echo "release_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo "$PREVIOUS_VERSION"

- name: version comparison
id: compare
run: |
python -m pip install semver

PREVIOUS_VERSION="${{ steps.latestreleased.outputs.release_tag }}"
NEW_VERSION="${{ github.event.inputs.version }}"

if [ -z "$PREVIOUS_VERSION" ]; then
echo "No previous release found"
exit 0
fi

output=$(pysemver compare "$PREVIOUS_VERSION" "$NEW_VERSION")

if [ "$output" -ge 0 ]; then
exit 1
fi

version:
name: prepare ${{ github.event.inputs.version }}
needs: checks
runs-on: ubuntu-24.04
steps:

- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Change version in repo and CITATION.cff
run: |
# Update Conda package version
sed -i \
"s/{% set version = \".*\" %}/{% set version = \"${{ github.event.inputs.version }}\" %}/" \
conda-recipe/meta.yaml

# Update CITATION.cff version and date-released
if [ -f CITATION.cff ]; then
sed -i -E \
"s/^(version:\s*).*/\1${{ github.event.inputs.version }}/" \
CITATION.cff

sed -i -E \
"s/^(date-released:\s*).*/\1'$(date -u +%F)'/" \
CITATION.cff
fi

- name: send PR
id: pr_id
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
commit-message: Update version to ${{ github.event.inputs.version }}
branch: version-update
title: "Update to version ${{ github.event.inputs.version }}"
body: |
Update version
- Update the Conda recipe with new release
- Update CITATION.cff version & date-released
- Auto-generated by [CI]
committer: version-updater <vu.bot@users.noreply.github.com>
author: version-updater <vu.bot@users.noreply.github.com>
base: main
signoff: false
draft: false

- name: auto approve review
uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
with:
pull-request-number: ${{ steps.pr_id.outputs.pull-request-number }}
review-message: "Auto approved version bump PR"
github-token: ${{ secrets.AUTO_PR_MERGE }}

- name: merge PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.pr_id.outputs.pull-request-number }}
run: |
gh pr merge \
--merge \
--delete-branch \
--auto \
"$PR_NUMBER"

while true; do
STATE=$(gh pr view "$PR_NUMBER" --json state --jq '.state')

if [ "$STATE" = "MERGED" ]; then
echo "Version bump PR merged"
break
fi

if [ "$STATE" = "CLOSED" ]; then
echo "Version bump PR was closed without merging"
exit 1
fi

sleep 10
done

tag:
name: tag release
needs: version
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: main

- name: tag v${{ github.event.inputs.version }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag ${{ github.event.inputs.version }}
git push origin tag ${{ github.event.inputs.version }}

release:
name: make github release
needs: tag
runs-on: ubuntu-24.04
steps:

- name: create release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
with:
name: v${{ github.event.inputs.version }}
generate_release_notes: true
tag_name: ${{ github.event.inputs.version }}

conda:
name: publish conda to anaconda.org
needs: [tag, release]
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.event.inputs.version }}

- name: Setup Conda
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4
with:
miniforge-variant: Miniforge3
python-version: "3.14"
auto-activate: true
activate-environment: base
conda-remove-defaults: true
channels: conda-forge,bioconda
channel-priority: strict

- name: Install build tools
shell: bash -l {0}
run: |
conda install -y \
--override-channels \
-c conda-forge \
conda-build \
anaconda-client

conda config --set anaconda_upload no
conda list conda-build
conda build --help

- name: Build package
shell: bash -l {0}
run: |
PKG_PATH=$(conda build conda-recipe \
--output \
--override-channels \
-c conda-forge \
-c bioconda)

echo "PKG_PATH=$PKG_PATH" >> "$GITHUB_ENV"

conda build conda-recipe \
--override-channels \
-c conda-forge \
-c bioconda \
--no-anaconda-upload

test -f "$PKG_PATH"
echo "Built: $PKG_PATH"

- name: Upload to Anaconda
shell: bash -l {0}
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda \
-t "$ANACONDA_API_TOKEN" \
upload "$PKG_PATH" \
--user CCPBioSim \
--force
36 changes: 36 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: SIST
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software

authors:

repository-code: 'https://github.com/CCPBioSim/SIST'
url: 'https://sist.readthedocs.io/en/latest/'

abstract: >-
SIST (Stress-Induced Structural Transitions) calculates
stress-induced structural transition probabilities in
superhelical DNA, including strand separation, Z-DNA
formation, cruciform extrusion, and competition between
these transitions.

keywords:
- DNA
- superhelical DNA
- DNA supercoiling
- strand separation
- Z-DNA
- cruciform extrusion
- structural transitions
- statistical mechanics
- biomolecular simulations

license: MIT
version: 0.0.0
date-released: '2026-08-14'
Loading