Skip to content

attempt to updgrade pip first #13

attempt to updgrade pip first

attempt to updgrade pip first #13

Workflow file for this run

name: Conda Release to Anaconda.org
on:
push:
tags:
- 'v*.*.*'
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
# 1) Check out the current repo (so we can access conda-recipe/)
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
# 2) Install Miniconda and conda-build/anaconda-client
- name: Install Miniconda and tools
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
conda install -y conda-build anaconda-client
# 3) Determine VERSION (strip the leading “v”) and compute SHA256
- name: Set version and SHA256
id: vars
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
# Download tarball for this tag and compute checksum
TAR_URL="https://github.com/${GITHUB_REPOSITORY}/archive/refs/tags/v${VERSION}.tar.gz"
curl -L $TAR_URL -o release.tar.gz
SHA256=$(sha256sum release.tar.gz | cut -d' ' -f1)
echo "SHA256=$SHA256" >> $GITHUB_OUTPUT
# 4) Update meta.yaml with the correct version and sha256
- name: Patch conda-recipe/meta.yaml
run: |
cd conda-recipe
# Extract OWNER and REPO from GITHUB_REPOSITORY (format: owner/repo)
OWNER=${GITHUB_REPOSITORY%%/*}
REPO=${GITHUB_REPOSITORY##*/}
# Replace the Jinja “{% set version = "..." %}” line:
sed -i "s|^{% set version = \".*\" %}|{% set version = \"${{ steps.vars.outputs.VERSION }}\" %}|" meta.yaml
# Replace the “ sha256: ...” line (two‐space indentation under source:)
sed -i "s|^ sha256: .*| sha256: ${{ steps.vars.outputs.SHA256 }}|" meta.yaml
# Update the source URL to use the real owner, repo, and version
# Original line looks like:
# url: <PLACEHOLDER>
sed -i "s|^ url: .*| url: https://github.com/${OWNER}/${REPO}/archive/v${{ steps.vars.outputs.VERSION }}.tar.gz|" meta.yaml
# Update the homepage URL to use the real owner and repo
# Original line looks like:
# home: <PLACEHOLDER>
sed -i "s|^ home: .*| home: https://github.com/${OWNER}/${REPO}|" meta.yaml
# 5) Build the conda package
- name: Build conda package
run: |
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
cd conda-recipe
conda-build . --output-folder ../conda-build-artifacts
# 6) Upload the built package to Anaconda.org
- name: Upload to Anaconda.org
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
PACKAGE=$(ls conda-build-artifacts/linux-64/aligncount-demo-${{ steps.vars.outputs.VERSION }}-*.tar.bz2)
anaconda -t $ANACONDA_TOKEN upload $PACKAGE --user $ANACONDA_USER --label main --force