Skip to content

.github/workflows/bioconda_pr.yaml #1

.github/workflows/bioconda_pr.yaml

.github/workflows/bioconda_pr.yaml #1

Workflow file for this run

name: Auto Bioconda PR with Test (Manual Only)
on:
workflow_dispatch:
jobs:
bioconda_pr:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Extract version and package name
id: vars
run: |
VERSION=$(grep -Po '__version__\s*=\s*"\K[0-9.]+' **/__init__.py | head -n1)
PACKAGE=$(basename "$GITHUB_REPOSITORY")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "PACKAGE=$PACKAGE"
- name: Download source archive and compute SHA256
run: |
url="https://github.com/kfuku52/${PACKAGE}/archive/refs/tags/v${VERSION}.tar.gz"
wget -O source.tar.gz "$url"
sha256=$(sha256sum source.tar.gz | awk '{print $1}')
echo "SHA256=$sha256" >> $GITHUB_ENV
- name: Clone your fork of bioconda-recipes
run: |
git clone https://github.com/kamome1201/bioconda-recipes.git
cd bioconda-recipes
git remote add upstream https://github.com/bioconda/bioconda-recipes.git
git fetch upstream
- name: Create new branch
run: |
cd bioconda-recipes
git checkout -b add-${PACKAGE}-${VERSION}
- name: Update meta.yaml version and sha256
run: |
sed -i "s/{% set version = \".*\" %}/{% set version = \"$VERSION\" %}/" ${PACKAGE}/meta.yaml
sed -i "s/sha256: .*/sha256: \"${SHA256}\"/" ${PACKAGE}/meta.yaml
- name: Copy recipe into bioconda-recipes
run: |
cp -r ${PACKAGE} bioconda-recipes/recipes/
- name: Create config.yml for bioconda-utils
run: |
cat <<EOF > bioconda-recipes/config.yml
channels:
- bioconda
- conda-forge
- defaults
EOF
- name: Run lint + build + test with bioconda-utils (Docker)
run: |
docker run --rm -v $PWD/bioconda-recipes:/bioconda-recipes \
quay.io/bioconda/bioconda-utils-build-env \
bioconda-utils build recipes config.yml --packages ${PACKAGE} --loglevel info --docker --git-range master
# - name: Commit and push
# run: |
# cd bioconda-recipes
# git add recipes/${PACKAGE}
# git commit -m "Update ${PACKAGE} recipe to v$VERSION"
# git push origin add-${PACKAGE}-${VERSION}
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v5
# with:
# token: ${{ secrets.GH_PAT }}
# title: "Update ${PACKAGE} recipe to v${{ env.VERSION }}"
# commit-message: "Auto PR for Bioconda: ${PACKAGE} v${{ env.VERSION }}"
# base: master
# branch: add-${PACKAGE}-${{ env.VERSION }}
# body: |
# This PR was automatically generated by GitHub Actions.
# - Package: ${{ env.PACKAGE }}
# - Version: v${{ env.VERSION }}
# - sha256: ${{ env.SHA256 }}