Skip to content

MACS3 Publish to Anaconda/macs3 #7

MACS3 Publish to Anaconda/macs3

MACS3 Publish to Anaconda/macs3 #7

# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: MACS3 Publish to Anaconda/macs3
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
arch: ['x64']
name: Build conda package in x64 under Python ${{ matrix.python-version }}
steps:
- name: Check out MACS3 with submodules
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install conda dependencies
run: |
conda config --set always_yes yes --set changeps1 no
# need conda-build/verify to test building conda package
conda install -q conda-build
conda install -q conda-verify
conda update -q conda
# Useful for debugging any issues with conda
conda info -a
# configure the channels
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels macs3
conda install -q mamba -c conda-forge
- name: Build conda package
run: |
mkdir bld-dir
conda build -q conda/macs3 --output-folder bld-dir
- name: Test installing conda package
run: |
# Now add this folder as a highest priority channel
conda config --add channels "file://`pwd`/bld-dir"
# install MACS3 from local repo
mamba create -q -n MACS3 macs3
# Activate this environment
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate MACS3
# list conda env packages for reference
conda list
- name: Test installed MACS3 package (cmdline)
run: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate MACS3
pytest --runxfail
cd test
./cmdlinetest macs3
cd ..
- name: Publish
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
mamba install anaconda-client
anaconda upload bld-dir/**/macs3-*.tar.bz2