Skip to content

Commit cb54b9a

Browse files
ENH: Use pixi to run action as composite (#91)
* ENH: Use pixi to run action as composite * Use pixi to manage the environment fully, which removes the needs for micromamba and a Linux container, allowing the action to be run as a 'composite' action. - This allows the action to be used on macOS runners in addition to Linux. - Add pixi project configuration and pixi lock file. - Add 'osx-64' and 'osx-arm64' platforms to pixi environment solves to allow for use on Linux and macOS runners. - Use prefix-dev/setup-pixi GitHub action to setup pixi for the action. - Explicitly enable the 'locked' option for prefix-dev/setup-pixi. - Don't allow for post job cleanup to avoid errors if the action is run multiple times in a workflow (this is a downside of no longer being in a Linux container). - Note: GitHub Actions takes care of cleaning up the environment after each run, so you are not responsible for manually unsetting all environment variables between steps to avoid secret leakage. - Make cmd.sh executable (chmod +x). * Remove use of micromamba in the upload script. * Remove the conda-lock files and the Docker based locking workflow. * Remove Dockerfile. * Note in the README that the runner used can be either Linux or macOS. * Update version numbers of action to v0.5.0. * MNT: Rename script to 'upload_wheels.sh' * As the script is no longer the CMD of a Linux container but is now a standalone Bash script, having a more descriptive name is preferable.
1 parent 08dac10 commit cb54b9a

11 files changed

Lines changed: 1973 additions & 1199 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# GitHub syntax highlighting
2+
pixi.lock linguist-language=YAML linguist-generated=true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# pixi environments
2+
.pixi
3+
*.egg-info

Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This is a GitHub Action that uploads nightly builds to the [scientific-python ni
44
as recommended in [SPEC4 — Using and Creating Nightly Wheels][].
55

66
In a GitHub Actions workflow (`.github/workflows/*.yaml`), use the
7-
following snippet to upload built wheels to the channel:
7+
following snippet on a Linux or macOS runner to upload built wheels to the
8+
channel:
89

910
```yml
1011
jobs:

action.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ permissions:
55
contents: read
66
metadata: read
77
author: "Scientific-Python"
8-
version: "0.1.0"
8+
version: "0.5.0"
99

1010
inputs:
1111
artifacts_path:
@@ -24,5 +24,23 @@ inputs:
2424
default: main
2525

2626
runs:
27-
using: 'docker'
28-
image: 'Dockerfile'
27+
using: "composite"
28+
steps:
29+
- name: Set up pixi
30+
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
31+
with:
32+
locked: true
33+
cache: true
34+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
35+
# Avoid post cleanup errors if action run multiple times
36+
post-cleanup: false
37+
38+
- name: Upload wheels
39+
shell: bash
40+
env:
41+
INPUT_ARTIFACTS_PATH: ${{ inputs.artifacts_path }}
42+
INPUT_ANACONDA_NIGHTLY_UPLOAD_ORGANIZATION: ${{ inputs.anaconda_nightly_upload_organization }}
43+
INPUT_ANACONDA_NIGHTLY_UPLOAD_TOKEN: ${{ inputs.anaconda_nightly_upload_token }}
44+
INPUT_ANACONDA_NIGHTLY_UPLOAD_LABELS: ${{ inputs.anaconda_nightly_upload_labels }}
45+
run: |
46+
pixi run upload_wheels.sh

0 commit comments

Comments
 (0)