Skip to content

bot-pypi-mapping #25359

bot-pypi-mapping

bot-pypi-mapping #25359

name: bot-pypi-mapping
on:
schedule:
- cron: '42 * * * *'
workflow_dispatch: null
concurrency: bot-pypi-mapping
jobs:
pypi-mapping:
name: pypi-mapping
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: free disk space
uses: endersonmenezes/free-disk-space@e6ed9b02e683a3b55ed0252f1ee469ce3b39a885 # v3
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
rm_cmd: "rmz"
- name: get latest release
id: latest_release
run: |
tag_name=$(gh api repos/regro/cf-scripts/releases/latest --jq '.tag_name')
echo "latest release: ${tag_name}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.latest_release.outputs.tag_name }}
path: cf-scripts
- uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc
- name: do local setup and stop me if needed
run: |
cd cf-scripts
python autotick-bot/stop_me_if_needed.py
- name: install bot code
if: success() && ! env.CI_SKIP
run: |
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
- name: build import to package mapping
if: success() && ! env.CI_SKIP
run: |
pushd cf-graph
conda-forge-tick make-import-to-package-mapping
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
- name: build pypi mapping
if: success() && ! env.CI_SKIP
run: |
pushd cf-graph
conda-forge-tick make-mappings
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
- name: deploy
if: github.ref == 'refs/heads/main' && ! cancelled() && ! env.CI_SKIP
run: |
pushd cf-graph
export RUN_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
conda-forge-tick deploy-to-github --git-only --no-pull
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
RUN_ID: ${{ github.run_id }}
- name: bump on fail
if: github.ref == 'refs/heads/main' && failure() && ! env.CI_SKIP
run: |
export ACTION_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
python cf-scripts/autotick-bot/bump_bot_team.py
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
RUN_ID: ${{ github.run_id }}
ACTION_NAME: ${{ github.workflow }}