@@ -75,13 +75,6 @@ def parse_command_line(argv):
7575 help = "How many packages to build at most per stage" ,
7676 )
7777
78- parser .add_argument (
79- "--prefix-channel" ,
80- dest = "prefix_channel" ,
81- default = None ,
82- help = "Publish to this prefix.dev channel using trusted publishing (replaces anaconda upload)" ,
83- )
84-
8578 arguments = parser .parse_args (argv [1 :])
8679 config .parsed_args = arguments
8780 return arguments
@@ -257,7 +250,6 @@ def build_unix_pipeline(
257250 outfile = "linux.yml" ,
258251 pipeline_name = "build_unix" ,
259252 target = "" ,
260- prefix_channel = None ,
261253):
262254 blurb = {"jobs" : {}, "name" : pipeline_name }
263255
@@ -276,13 +268,10 @@ def build_unix_pipeline(
276268 pretty_stage_name = get_stage_name (batch )
277269
278270 build_env = {
271+ "ANACONDA_API_TOKEN" : "${{ secrets.ANACONDA_API_TOKEN }}" ,
279272 "CURRENT_RECIPES" : f"{ ' ' .join ([pkg for pkg in batch ])} " ,
280273 "BUILD_TARGET" : target ,
281274 }
282- if prefix_channel :
283- build_env ["PREFIX_UPLOAD_CHANNEL" ] = prefix_channel
284- else :
285- build_env ["ANACONDA_API_TOKEN" ] = "${{ secrets.ANACONDA_API_TOKEN }}"
286275
287276 steps = [
288277 {
@@ -296,25 +285,6 @@ def build_unix_pipeline(
296285 },
297286 ]
298287
299- if prefix_channel :
300- target_glob = f"{ target } *" if target else "*"
301- upload_script = lu (
302- f'if compgen -G "$HOME/conda-bld/{ target_glob } /*.conda" > /dev/null; then\n '
303- f" ~/.pixi/bin/rattler-build upload prefix"
304- f" --channel { prefix_channel } "
305- f" --generate-attestation"
306- f" $HOME/conda-bld/{ target_glob } /*.conda\n "
307- f"else\n "
308- f' echo "No packages to upload to prefix.dev"\n '
309- f"fi\n "
310- )
311- steps .append (
312- {
313- "name" : "Upload to prefix.dev" ,
314- "run" : upload_script ,
315- }
316- )
317-
318288 job = {
319289 "name" : pretty_stage_name ,
320290 "runs-on" : runs_on ,
@@ -323,11 +293,10 @@ def build_unix_pipeline(
323293 "steps" : steps ,
324294 }
325295
326- if prefix_channel :
327- job ["permissions" ] = {
328- "id-token" : "write" ,
329- "attestations" : "write" ,
330- }
296+ job ["permissions" ] = {
297+ "id-token" : "write" ,
298+ "attestations" : "write" ,
299+ }
331300
332301 azure_template ["jobs" ][batch_key ] = job
333302
@@ -349,7 +318,6 @@ def build_linux_pipeline(
349318 runs_on = "ubuntu-latest" ,
350319 outfile = "linux.yml" ,
351320 pipeline_name = "build_linux" ,
352- prefix_channel = None ,
353321):
354322 build_unix_pipeline (
355323 stages ,
@@ -360,7 +328,6 @@ def build_linux_pipeline(
360328 outfile = outfile ,
361329 pipeline_name = pipeline_name ,
362330 target = "linux-64" ,
363- prefix_channel = prefix_channel ,
364331 )
365332
366333
@@ -373,7 +340,6 @@ def build_osx_pipeline(
373340 script = azure_unix_script ,
374341 target = "osx-64" ,
375342 pipeline_name = "build_osx64" ,
376- prefix_channel = None ,
377343):
378344 build_unix_pipeline (
379345 stages ,
@@ -384,12 +350,11 @@ def build_osx_pipeline(
384350 outfile = outfile ,
385351 target = target ,
386352 pipeline_name = pipeline_name ,
387- prefix_channel = prefix_channel ,
388353 )
389354
390355
391356def build_win_pipeline (
392- stages , trigger_branch , outfile = "win.yml" , azure_template = None , prefix_channel = None
357+ stages , trigger_branch , outfile = "win.yml" , azure_template = None
393358):
394359 vm_imagename = "windows-2022"
395360 # Build Win pipeline
@@ -416,13 +381,10 @@ def build_win_pipeline(
416381 pretty_stage_name = get_stage_name (batch )
417382
418383 build_env = {
384+ "ANACONDA_API_TOKEN" : "${{ secrets.ANACONDA_API_TOKEN }}" ,
419385 "CURRENT_RECIPES" : f"{ ' ' .join ([pkg for pkg in batch ])} " ,
420386 "PYTHONUNBUFFERED" : 1 ,
421387 }
422- if prefix_channel :
423- build_env ["PREFIX_UPLOAD_CHANNEL" ] = prefix_channel
424- else :
425- build_env ["ANACONDA_API_TOKEN" ] = "${{ secrets.ANACONDA_API_TOKEN }}"
426388
427389 steps = [
428390 {"name" : "Checkout code" , "uses" : "actions/checkout@v6" },
@@ -453,21 +415,6 @@ def build_win_pipeline(
453415 },
454416 ]
455417
456- if prefix_channel :
457- upload_script = lu (
458- f"pixi run rattler-build upload prefix"
459- f" --channel { prefix_channel } "
460- f" --generate-attestation"
461- f" C:\\ bld\\ win-64\\ *.conda\n "
462- )
463- steps .append (
464- {
465- "shell" : "cmd" ,
466- "name" : "Upload to prefix.dev" ,
467- "run" : upload_script ,
468- }
469- )
470-
471418 job = {
472419 "name" : pretty_stage_name ,
473420 "runs-on" : vm_imagename ,
@@ -480,11 +427,10 @@ def build_win_pipeline(
480427 "steps" : steps ,
481428 }
482429
483- if prefix_channel :
484- job ["permissions" ] = {
485- "id-token" : "write" ,
486- "attestations" : "write" ,
487- }
430+ job ["permissions" ] = {
431+ "id-token" : "write" ,
432+ "attestations" : "write" ,
433+ }
488434
489435 azure_template ["jobs" ][batch_key ] = job
490436
@@ -631,22 +577,18 @@ def main():
631577
632578 fo .write ("\n " .join (order ))
633579
634- prefix_channel = args .prefix_channel
635-
636580 if args .platform == "linux-64" :
637581 build_unix_pipeline (
638582 stages ,
639583 args .trigger_branch ,
640584 outfile = "linux.yml" ,
641585 pipeline_name = "build_linux64" ,
642- prefix_channel = prefix_channel ,
643586 )
644587
645588 if args .platform == "osx-64" :
646589 build_osx_pipeline (
647590 stages ,
648591 args .trigger_branch ,
649- prefix_channel = prefix_channel ,
650592 )
651593
652594 if args .platform == "osx-arm64" :
@@ -658,7 +600,6 @@ def main():
658600 script = azure_unix_script ,
659601 target = platform ,
660602 pipeline_name = "build_osx_arm64" ,
661- prefix_channel = prefix_channel ,
662603 )
663604
664605 if args .platform == "linux-aarch64" :
@@ -670,17 +611,11 @@ def main():
670611 outfile = "linux_aarch64.yml" ,
671612 target = platform ,
672613 pipeline_name = "build_linux_aarch64" ,
673- prefix_channel = prefix_channel ,
674614 )
675615
676616 # windows
677617 if args .platform == "win-64" :
678- build_win_pipeline (
679- stages ,
680- args .trigger_branch ,
681- outfile = "win.yml" ,
682- prefix_channel = prefix_channel ,
683- )
618+ build_win_pipeline (stages , args .trigger_branch , outfile = "win.yml" )
684619
685620 if args .platform == "emscripten-wasm32" :
686621 build_unix_pipeline (
@@ -689,5 +624,4 @@ def main():
689624 outfile = "emscripten_wasm32.yml" ,
690625 pipeline_name = "build_emscripten_wasm32" ,
691626 target = "emscripten-wasm32" ,
692- prefix_channel = prefix_channel ,
693627 )
0 commit comments