Skip to content

Commit

Permalink
ENH: Use pixi to run action as composite (#91)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
matthewfeickert authored Sep 27, 2024
1 parent 08dac10 commit cb54b9a
Show file tree
Hide file tree
Showing 11 changed files with 1,973 additions and 1,199 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pixi environments
.pixi
*.egg-info
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ This is a GitHub Action that uploads nightly builds to the [scientific-python ni
as recommended in [SPEC4 — Using and Creating Nightly Wheels][].

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

```yml
jobs:
Expand Down
24 changes: 21 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
contents: read
metadata: read
author: "Scientific-Python"
version: "0.1.0"
version: "0.5.0"

inputs:
artifacts_path:
Expand All @@ -24,5 +24,23 @@ inputs:
default: main

runs:
using: 'docker'
image: 'Dockerfile'
using: "composite"
steps:
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
locked: true
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
# Avoid post cleanup errors if action run multiple times
post-cleanup: false

- name: Upload wheels
shell: bash
env:
INPUT_ARTIFACTS_PATH: ${{ inputs.artifacts_path }}
INPUT_ANACONDA_NIGHTLY_UPLOAD_ORGANIZATION: ${{ inputs.anaconda_nightly_upload_organization }}
INPUT_ANACONDA_NIGHTLY_UPLOAD_TOKEN: ${{ inputs.anaconda_nightly_upload_token }}
INPUT_ANACONDA_NIGHTLY_UPLOAD_LABELS: ${{ inputs.anaconda_nightly_upload_labels }}
run: |
pixi run upload_wheels.sh
Loading

0 comments on commit cb54b9a

Please sign in to comment.