.github/workflows/updater_conda_forge.yml #15959
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name: Run updater for conda-forge that will check for conda-forge packages | |
on: | |
schedule: | |
# run the job every 10 minutes | |
- cron: '*/10 * * * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
generate_hash_letters: | |
runs-on: ubuntu-latest | |
outputs: | |
string_list: ${{ steps.generate.outputs.string_list }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' # Specify your Python version | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: "latest" | |
manifest-path: pyproject.toml | |
- name: pixi install | |
run: | | |
pixi install | |
- name: Generate combination of missing subdirs and letters | |
id: generate | |
run: | | |
# Run your script here to produce a list of missing subdirs and letters | |
# example: linux-64@p linux-64@d | |
message=$(pixi run parselmouth updater-producer --channel conda-forge) | |
echo $message | |
echo "string_list=$message" >> $GITHUB_OUTPUT | |
env: | |
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }} | |
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }} | |
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }} | |
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }} | |
- name: Upload requested index.json | |
uses: actions/upload-artifact@v4 | |
with: | |
name: index | |
path: output_index | |
updater_of_records: | |
runs-on: ubuntu-latest | |
needs: generate_hash_letters | |
strategy: | |
matrix: | |
subdirs: ${{fromJson(needs.generate_hash_letters.outputs.string_list)}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: "latest" | |
manifest-path: pyproject.toml | |
- name: pixi install | |
run: | | |
pixi install | |
- name: Get partial index artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: index | |
path: output_index | |
- name: Get artifact info for subdir@letter and save into partial index | |
run: pixi run parselmouth updater ${{ matrix.subdirs }} --channel conda-forge --upload | |
env: | |
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }} | |
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }} | |
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }} | |
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }} | |
- name: Upload partial index | |
uses: actions/upload-artifact@v4 | |
with: | |
name: partial_index_${{ matrix.subdirs }} | |
path: output | |
updater_of_index: | |
runs-on: ubuntu-latest | |
needs: updater_of_records | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' # Specify your Python version | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: "latest" | |
manifest-path: pyproject.toml | |
- name: pixi install | |
run: | | |
pixi install | |
- name: Get partial index artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: output | |
- name: Combine all partial index and save into S3 index | |
run: pixi run parselmouth updater-merger --upload --channel conda-forge | |
env: | |
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }} | |
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }} | |
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }} | |
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }} | |
update_file: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # To push on main branch | |
needs: updater_of_index | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: "latest" | |
manifest-path: pyproject.toml | |
- name: Update grayskull mapping and compressed mapping | |
run: | | |
pixi run parselmouth update-mapping-legacy | |
pixi run parselmouth update-mapping | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
R2_PREFIX_ACCOUNT_ID: ${{ secrets.R2_PREFIX_ACCOUNT_ID }} | |
R2_PREFIX_ACCESS_KEY_ID: ${{ secrets.R2_PREFIX_ACCESS_KEY_ID }} | |
R2_PREFIX_SECRET_ACCESS_KEY: ${{ secrets.R2_PREFIX_SECRET_ACCESS_KEY }} | |
R2_PREFIX_BUCKET: ${{ secrets.R2_PREFIX_BUCKET }} | |
- name: Commit and push changes | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add files/mapping_as_grayskull.json | |
git add files/compressed_mapping.json | |
git add files/v0 | |
git commit -m "Update file via GitHub Action" || true | |
git push |