Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Apr 29, 2024
1 parent a16554d commit 7aa018d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/mirror_repodata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mirror repodata

on:
workflow_dispatch:
inputs:
channel:
description: 'The channel to mirror'
required: true
default: 'conda-forge'
subdirs:
description: 'The subdirs to mirror'
required: true
default: 'linux-64,osx-arm64,win-64,noarch'
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.20.1
cache: true
- env:

run: |
pixi run start --channel ${{ github.event.inputs.channel }} --subdirs ${{ github.event.inputs.subdirs }}
8 changes: 8 additions & 0 deletions py/split_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ def files_to_upload(outpath, timestamp, subdir, channel_name):
]
subdirs = args.subdirs if not args.all_subdirs else all_subdirs

final_subdirs = []
for s in subdirs:
if "," in s:
final_subdirs.extend(s.split(","))
else:
final_subdirs.append(s)
subdirs = final_subdirs

channel_name = args.channel
outpath = Path(args.cache_dir) / channel_name
timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
Expand Down

0 comments on commit 7aa018d

Please sign in to comment.