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
88 changes: 88 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
with:
fetch-depth: 0

- name: Get latest release from pip
id: latestreleased
run: |
PREVIOUS_VERSION=$(python -m pip index versions biosim-schema | grep "biosim-schema" | cut -d "(" -f2 | cut -d ")" -f1)
echo "pip_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo $PREVIOUS_VERSION

- name: Ensure version is greater than latest git tag
run: |
NEW_VERSION="${{ github.event.inputs.version }}"
Expand Down Expand Up @@ -226,3 +233,84 @@ jobs:
--data-urlencode "to=announcements" \
--data-urlencode "topic=software releases" \
--data-urlencode "content=${CONTENT}"

pypi:
name: make pypi release
needs: [tag, release]
runs-on: ubuntu-24.04
steps:

- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main

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

- name: Install flit
run: |
python -m pip install --upgrade pip
python -m pip install "flit>=4,<5"

- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

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

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main

- name: Set version in conda recipe
run: |
sed -i "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml
grep '{% set version' conda-recipe/meta.yaml

- name: Setup Conda (conda-forge only)
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
miniforge-variant: Miniforge3
python-version: "3.14.7"
auto-activate: true
activate-environment: base
conda-remove-defaults: true
channels: conda-forge
channel-priority: strict

- name: Install build tools
shell: bash -l {0}
run: |
conda install -y conda-build anaconda-client
conda config --set anaconda_upload no
conda list conda-build
conda build --help

- name: Build package
shell: bash -l {0}
env:
PIP_NO_INDEX: "0"
run: |
PKG_PATH=$(conda build conda-recipe --output)
echo "PKG_PATH=$PKG_PATH" >> "$GITHUB_ENV"
conda build conda-recipe
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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repos:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-yaml
exclude: ^conda-recipe/meta\.yaml$
- id: check-toml
- id: end-of-file-fixer
exclude: ^project/
Expand Down
Loading
Loading