Skip to content

Replace mypy with ty #222

Replace mypy with ty

Replace mypy with ty #222

Workflow file for this run

name: Build conda-self package
on:
push:
branches:
- main
paths:
- ".github/workflows/build.yml"
- "conda_self/**"
- "pixi.lock"
- "pyproject.toml"
- "recipe/**"
- "tests/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/build.yml"
- "conda_self/**"
- "pixi.lock"
- "pyproject.toml"
- "recipe/**"
- "tests/**"
concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build-conda:
name: Build conda package
runs-on: ubuntu-latest
env:
CONDA_BLD_PATH: ${{ github.workspace }}/pkgs
PIXI_ENV_NAME: build
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: prefix-dev/setup-pixi@f00437f565399d418b0acc85936d12c1fb668347 # v0.10.1
with:
environments: ${{ env.PIXI_ENV_NAME }}
- name: Build recipe
run: pixi run --environment ${{ env.PIXI_ENV_NAME }} build --channel conda-forge --channel main
- name: Upload to conda-canary
if: >-
github.event_name == 'push'
&& !cancelled()
&& !github.event.repository.fork
&& github.ref_name == 'main'
shell: bash
env:
ANACONDA_ORG_CHANNEL: conda-canary
ANACONDA_ORG_LABEL: dev
BINSTAR_API_TOKEN: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }}
PACKAGE_NAME: conda-self
run: |
SEARCH_ROOT="$CONDA_BLD_PATH/noarch"
if [[ ! -d "$SEARCH_ROOT" ]]; then
echo "Expected build output directory $SEARCH_ROOT not found" >&2
exit 1
fi
PACKAGES=(
$(
find "$SEARCH_ROOT" -type f \
\( -name "${PACKAGE_NAME}-*.conda" -o -name "${PACKAGE_NAME}-*.tar.bz2" \) \
-print | sort
)
)
if [[ ${#PACKAGES[@]} -eq 0 ]]; then
echo "No conda packages found in $SEARCH_ROOT" >&2
exit 1
fi
printf 'Uploading packages to %s/label/%s:\n' "$ANACONDA_ORG_CHANNEL" "$ANACONDA_ORG_LABEL"
printf ' %s\n' "${PACKAGES[@]}"
pixi run --environment ${{ env.PIXI_ENV_NAME }} \
anaconda \
upload \
--force \
--register \
--no-progress \
--user "$ANACONDA_ORG_CHANNEL" \
--label "$ANACONDA_ORG_LABEL" \
"${PACKAGES[@]}"