Skip to content

Merge pull request #300 from bigbio/automation/sync-sdrf-templates-main #692

Merge pull request #300 from bigbio/automation/sync-sdrf-templates-main

Merge pull request #300 from bigbio/automation/sync-sdrf-templates-main #692

Workflow file for this run

name: Conda Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for setuptools-scm
- name: Set version for setuptools-scm
run: |
# Get current branch name
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
# Try to get version from git tags
if git describe --tags --exact-match 2>/dev/null; then
# On a tag - use the tag version
VERSION=$(git describe --tags --exact-match | sed 's/^v//')
else
# Not on a tag - create dev version with branch name
COMMIT_SHORT=$(git rev-parse --short HEAD)
# Replace slashes with underscores for branch name (setuptools-scm format)
BRANCH_SAFE=$(echo "$BRANCH_NAME" | sed 's/\//_/g')
VERSION="0.0.0+${BRANCH_SAFE}.${COMMIT_SHORT}"
fi
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION" >> $GITHUB_ENV
echo "Building version: $VERSION (branch: $BRANCH_NAME)"
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: sdrf-pipelines-build
auto-activate-base: false
auto-update-conda: true
python-version: '3.13'
channels: bioconda,conda-forge,defaults
- name: Install build dependencies
run: |
conda install -n sdrf-pipelines-build conda-build conda-verify anaconda-client
- name: Verify conda recipe
run: |
conda-verify .
- name: Build and test the sdrf-pipelines package
run: |
# conda build automatically runs the tests defined in meta.yaml test section
conda build --package-format .tar.bz2 recipe
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.SETUPTOOLS_SCM_PRETEND_VERSION }}