mirror of
https://github.com/prefix-dev/setup-pixi
synced 2026-10-08 15:04:08 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0a2ad1b73 | ||
|
|
d2ec573e39 | ||
|
|
364fd4a471 | ||
|
|
d3921e201b | ||
|
|
da13ca0475 | ||
|
|
aaf4a7974f | ||
|
|
93dbcae723 | ||
|
|
710eaf3767 | ||
|
|
4fff2fe0d5 | ||
|
|
4ffa03f79e | ||
|
|
94888c4be7 | ||
|
|
0a92b78ec2 | ||
|
|
73721a4a25 | ||
|
|
daf1d94cb0 | ||
|
|
ed66d56836 | ||
|
|
be4e12d1ed | ||
|
|
2d35805042 | ||
|
|
1a80a4f562 | ||
|
|
265e2c593b | ||
|
|
2023b09192 | ||
|
|
4bb84de5dd | ||
|
|
ccc5c07ed9 | ||
|
|
69d34221c7 | ||
|
|
f5fc2c8748 | ||
|
|
b4f12ad354 | ||
|
|
cc9010b767 | ||
|
|
ed6036947b | ||
|
|
28e30101b7 | ||
|
|
557d81653f | ||
|
|
a784a3155d | ||
|
|
f19fc8f1fd | ||
|
|
b6cda42ffe | ||
|
|
5eaef48d51 | ||
|
|
fbf0d0d598 |
@@ -3,14 +3,16 @@ updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
interval: monthly
|
||||
groups:
|
||||
dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
- package-ecosystem: npm
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
interval: monthly
|
||||
groups:
|
||||
dev-dependencies:
|
||||
dependencies:
|
||||
patterns:
|
||||
- "*eslint*"
|
||||
- "@types/*"
|
||||
- "prettier"
|
||||
- "*"
|
||||
|
||||
@@ -6,6 +6,8 @@ on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
merge_group:
|
||||
schedule:
|
||||
- cron: 0 6 * * MON
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -19,7 +21,7 @@ jobs:
|
||||
version: 8
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
@@ -29,6 +31,93 @@ jobs:
|
||||
|
||||
- name: Rebuild the dist/ directory
|
||||
run: pnpm build
|
||||
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
reference-latest-version-in-readme:
|
||||
name: Reference latest version in README
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Assert latest setup-pixi version is mentioned in README
|
||||
run: |
|
||||
set -euo pipefail
|
||||
latest_version="$(jq -r '.version' package.json)"
|
||||
count_expected=10
|
||||
count_actual="$(grep -c "setup-pixi@v$latest_version" README.md || true)"
|
||||
if [ "$count_actual" -ne "$count_expected" ]; then
|
||||
echo "::error file=README.md::Expected $count_expected mentions of \`setup-pixi@v$latest_version\` in README.md, but found $count_actual."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
reference-latest-pixi-version-in-readme:
|
||||
name: Reference latest Pixi version in README
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Assert latest pixi version is mentioned in README
|
||||
run: |
|
||||
set -euo pipefail
|
||||
latest_version="$(gh repo view --json latestRelease prefix-dev/pixi | jq -r '.latestRelease.tagName')"
|
||||
count_expected=1
|
||||
count_actual="$(grep -c "pixi-version: $latest_version" README.md || true)"
|
||||
if [ "$count_actual" -ne "$count_expected" ]; then
|
||||
echo "::error file=README.md::Expected $count_expected mentions of \`pixi-version: $latest_version\` in README.md, but found $count_actual."
|
||||
sed -i "s/pixi-version: .*/pixi-version: $latest_version/" README.md
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
||||
if: failure() && github.ref_name == 'main'
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: Reference latest Pixi version in README
|
||||
title: Reference latest Pixi version in README
|
||||
labels: documentation
|
||||
|
||||
check-dist:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Rebuild the dist/ directory
|
||||
run: pnpm build
|
||||
|
||||
- name: Compare the expected and actual dist/ directories
|
||||
run: |
|
||||
if [ "$(git diff --ignore-space-at-eol dist/* | wc -l)" -gt "0" ]; then
|
||||
echo "Detected uncommitted changes after build. See status below:"
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
id: diff
|
||||
|
||||
# If index.js or post.js are different than expected, upload the expected version as an artifact
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
name: Check dist
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
check-dist:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Rebuild the dist/ directory
|
||||
run: pnpm build
|
||||
|
||||
- name: Compare the expected and actual dist/ directories
|
||||
run: |
|
||||
if [ "$(git diff --ignore-space-at-eol dist/* | wc -l)" -gt "0" ]; then
|
||||
echo "Detected uncommitted changes after build. See status below:"
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
id: diff
|
||||
|
||||
# If index.js or post.js are different than expected, upload the expected version as an artifact
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
+32
-13
@@ -12,12 +12,17 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
cache: [true, false]
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: default ${{ matrix.cache == true && 'with' || 'without' }} cache (${{ matrix.os }})
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
# check the action logs to see if the cache was used or not
|
||||
with:
|
||||
cache: ${{ matrix.cache }}
|
||||
- run: |
|
||||
set -o pipefail
|
||||
pixi info
|
||||
@@ -48,6 +53,7 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
run-install: false
|
||||
cache: false
|
||||
- run: |
|
||||
! test -d .pixi
|
||||
shell: bash
|
||||
@@ -63,6 +69,7 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
pixi-version: v0.1.0
|
||||
# pixi 0.1.0 doesn't support --locked
|
||||
locked: false
|
||||
@@ -79,6 +86,7 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
frozen: true
|
||||
- run: pixi run python --version | grep -q 3.11
|
||||
|
||||
@@ -93,6 +101,7 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
locked: true
|
||||
- run: pixi run python --version | grep -q 3.11
|
||||
|
||||
@@ -104,11 +113,12 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
pixi-url: https://github.com/prefix-dev/pixi/releases/download/v0.0.8/pixi-x86_64-unknown-linux-musl
|
||||
# pixi 0.0.8 doesn't support --locked
|
||||
locked: false
|
||||
- run: pixi --version | grep -q "pixi 0.0.8"
|
||||
|
||||
|
||||
custom-manifest-path:
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -118,6 +128,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
manifest-path: test/default/pixi.toml
|
||||
|
||||
different-log-level:
|
||||
@@ -131,6 +142,7 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
log-level: v
|
||||
|
||||
custom-bin-path:
|
||||
@@ -144,6 +156,7 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
pixi-bin-path: custom-bin/pixi${{ matrix.os == 'windows-latest' && '.exe' || '' }}
|
||||
- run: |
|
||||
test -f custom-bin/pixi${{ matrix.os == 'windows-latest' && '.exe' || '' }}
|
||||
@@ -163,12 +176,12 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
auth-host: https://custom-conda-registry.com
|
||||
auth-token: custom-token
|
||||
- run: |
|
||||
grep -q "BearerToken" ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-conda-registry.com" ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-token" ~/.rattler/rattler_auth_store.json
|
||||
cat ~/.rattler/credentials.json
|
||||
[ $(jq '."*.custom-conda-registry.com".BearerToken' -r ~/.rattler/credentials.json) = "custom-token" ]
|
||||
# all other platforms have the credentials stored in the keychain
|
||||
# https://github.com/prefix-dev/pixi/issues/330
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
@@ -184,14 +197,14 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
auth-host: https://custom-conda-registry.com
|
||||
auth-username: custom-username
|
||||
auth-password: custom-password
|
||||
- run: |
|
||||
grep -q "BasicHTTP" ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-conda-registry.com" ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-username" ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-password" ~/.rattler/rattler_auth_store.json
|
||||
cat ~/.rattler/credentials.json
|
||||
[ $(jq '."*.custom-conda-registry.com".BasicHTTP.username' -r ~/.rattler/credentials.json) = "custom-username" ]
|
||||
[ $(jq '."*.custom-conda-registry.com".BasicHTTP.password' -r ~/.rattler/credentials.json) = "custom-password" ]
|
||||
# all other platforms have the credentials stored in the keychain
|
||||
# https://github.com/prefix-dev/pixi/issues/330
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
@@ -207,13 +220,12 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
auth-host: https://custom-conda-registry.com
|
||||
auth-conda-token: custom-conda-token
|
||||
- run: |
|
||||
grep "CondaToken" ~/.rattler/rattler_auth_store.json
|
||||
cat ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-conda-registry.com" ~/.rattler/rattler_auth_store.json
|
||||
grep -q "custom-conda-token" ~/.rattler/rattler_auth_store.json
|
||||
cat ~/.rattler/credentials.json
|
||||
[ $(jq '."*.custom-conda-registry.com".CondaToken' -r ~/.rattler/credentials.json) = "custom-conda-token" ]
|
||||
# all other platforms have the credentials stored in the keychain
|
||||
# https://github.com/prefix-dev/pixi/issues/330
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
@@ -229,6 +241,7 @@ jobs:
|
||||
run: mv test/auth/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
auth-host: https://repo.prefix.dev
|
||||
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
|
||||
- name: Ensure private-package is installed
|
||||
@@ -245,6 +258,8 @@ jobs:
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
- run: |
|
||||
python --version | grep -q "3.11"
|
||||
shell: pixi run bash {0}
|
||||
@@ -273,6 +288,7 @@ jobs:
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
# ~/.rattler is only created if the user has logged in
|
||||
auth-host: https://custom-conda-registry.com
|
||||
@@ -297,6 +313,7 @@ jobs:
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
|
||||
post-cleanup-macos:
|
||||
@@ -317,6 +334,7 @@ jobs:
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
|
||||
post-cleanup-windows:
|
||||
@@ -337,8 +355,9 @@ jobs:
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
|
||||
|
||||
no-lockfile:
|
||||
strategy:
|
||||
matrix:
|
||||
|
||||
@@ -23,9 +23,9 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m
|
||||
## Usage
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
pixi-version: v0.5.0
|
||||
pixi-version: v0.12.0
|
||||
cache: true
|
||||
auth-host: prefix.dev
|
||||
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
|
||||
@@ -34,8 +34,23 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m
|
||||
|
||||
> [!WARNING]
|
||||
> Since pixi is not yet stable, the API of this action may change between minor versions.
|
||||
> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.3.0`) to avoid breaking changes.
|
||||
> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.4.2`) to avoid breaking changes.
|
||||
> You can automatically update the version of this action by using [Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot).
|
||||
>
|
||||
> Put the following in your `.github/dependabot.yml` file to enable Dependabot for your GitHub Actions:
|
||||
>
|
||||
> ```yml
|
||||
> version: 2
|
||||
> updates:
|
||||
> - package-ecosystem: github-actions
|
||||
> directory: /
|
||||
> schedule:
|
||||
> interval: monthly # or daily, weekly
|
||||
> groups:
|
||||
> dependencies:
|
||||
> patterns:
|
||||
> - "*"
|
||||
> ```
|
||||
|
||||
## Features
|
||||
|
||||
@@ -43,13 +58,27 @@ To see all available input arguments, see the [`action.yml`](action.yml) file.
|
||||
|
||||
### Caching
|
||||
|
||||
The action supports caching of the pixi environment. To enable caching, set `cache: true`.
|
||||
The action supports caching of the pixi environment.
|
||||
By default, caching is enabled if a `pixi.lock` file is present.
|
||||
It will then use the `pixi.lock` file to generate a hash of the environment and cache it.
|
||||
If the cache is hit, the action will skip the installation and use the cached environment.
|
||||
You can specify the behavior by setting the `cache` input argument.
|
||||
|
||||
If you need to customize your cache-key, you can use the `cache-key` input argument.
|
||||
This will be the prefix of the cache key. The full cache key will be `<cache-key><conda-arch>-<hash>`.
|
||||
|
||||
#### Only save caches on `main`
|
||||
|
||||
In order to not exceed the [10 GB cache size limit](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) as fast, you might want to restrict when the cache is saved.
|
||||
This can be done by setting the `cache-write` argument.
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
cache: true
|
||||
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
|
||||
```
|
||||
|
||||
### Authentication
|
||||
|
||||
There are currently three ways to authenticate with pixi:
|
||||
@@ -71,7 +100,7 @@ Specify the token using the `auth-token` input argument.
|
||||
This form of authentication (bearer token in the request headers) is mainly used at [prefix.dev](https://prefix.dev).
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
auth-host: prefix.dev
|
||||
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
|
||||
@@ -83,7 +112,7 @@ Specify the username and password using the `auth-username` and `auth-password`
|
||||
This form of authentication (HTTP Basic Auth) is used in some enterprise environments with [artifactory](https://jfrog.com/artifactory) for example.
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
auth-host: custom-artifactory.com
|
||||
auth-username: ${{ secrets.PIXI_USERNAME }}
|
||||
@@ -96,7 +125,7 @@ Specify the conda-token using the `conda-token` input argument.
|
||||
This form of authentication (token is encoded in URL: `https://my-quetz-instance.com/t/<token>/get/custom-channel`) is used at [anaconda.org](https://anaconda.org) or with [quetz instances](https://github.com/mamba-org/quetz).
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
auth-host: anaconda.org # or my-quetz-instance.com
|
||||
conda-token: ${{ secrets.CONDA_TOKEN }}
|
||||
@@ -134,7 +163,7 @@ You can specify whether `setup-pixi` should run `pixi install --frozen` or `pixi
|
||||
See the [official documentation](https://prefix.dev/docs/pixi/cli#install) for more information about the `--frozen` and `--locked` flags.
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
locked: true
|
||||
# or
|
||||
@@ -153,7 +182,7 @@ The first one is the debug logging of the action itself.
|
||||
This can be enabled by running the action with the `RUNNER_DEBUG` environment variable set to `true`.
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
env:
|
||||
RUNNER_DEBUG: true
|
||||
```
|
||||
@@ -171,7 +200,7 @@ The second type is the debug logging of the pixi executable.
|
||||
This can be specified by setting the `log-level` input.
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
# one of `q`, `default`, `v`, `vv`, or `vvv`.
|
||||
log-level: vvv
|
||||
@@ -179,9 +208,9 @@ This can be specified by setting the `log-level` input.
|
||||
|
||||
If nothing is specified, `setup-pixi` will default to `default` or `vv` depending on if [debug logging is enabled for the action](#debug-logging-of-the-action).
|
||||
|
||||
### Post action cleanup
|
||||
### Self-hosted runners
|
||||
|
||||
On self hosted runners, it may happen that some files are persisted between jobs.
|
||||
On self-hosted runners, it may happen that some files are persisted between jobs.
|
||||
This can lead to problems or secrets getting leaked between job runs.
|
||||
To avoid this, you can use the `post-cleanup` input to specify the post cleanup behavior of the action (i.e., what happens _after_ all your commands have been executed).
|
||||
|
||||
@@ -194,10 +223,14 @@ If you set `post-cleanup` to `true`, the action will delete the following files:
|
||||
|
||||
If nothing is specified, `setup-pixi` will default to `true`.
|
||||
|
||||
On self-hosted runners, you also might want to alter the default pixi install location to a temporary location. You can use `pixi-bin-path: ${{ runner.temp }}/bin/pixi` to do this.
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
- uses: prefix-dev/setup-pixi@v0.4.2
|
||||
with:
|
||||
post-cleanup: false
|
||||
post-cleanup: true
|
||||
# ${{ runner.temp }}\Scripts\pixi.exe on Windows
|
||||
pixi-bin-path: ${{ runner.temp }}/bin/pixi
|
||||
```
|
||||
|
||||
## More examples
|
||||
|
||||
+63
-40
@@ -26607,7 +26607,7 @@ var require_builder = __commonJS({
|
||||
} else {
|
||||
rootName = this.options.rootName;
|
||||
}
|
||||
render = function(_this) {
|
||||
render = /* @__PURE__ */ function(_this) {
|
||||
return function(element, obj) {
|
||||
var attr, child, entry, index, key, value;
|
||||
if (typeof obj !== "object") {
|
||||
@@ -28302,7 +28302,7 @@ var require_parser = __commonJS({
|
||||
xmlns: this.options.xmlns
|
||||
});
|
||||
this.saxParser.errThrown = false;
|
||||
this.saxParser.onerror = function(_this) {
|
||||
this.saxParser.onerror = /* @__PURE__ */ function(_this) {
|
||||
return function(error2) {
|
||||
_this.saxParser.resume();
|
||||
if (!_this.saxParser.errThrown) {
|
||||
@@ -28311,7 +28311,7 @@ var require_parser = __commonJS({
|
||||
}
|
||||
};
|
||||
}(this);
|
||||
this.saxParser.onend = function(_this) {
|
||||
this.saxParser.onend = /* @__PURE__ */ function(_this) {
|
||||
return function() {
|
||||
if (!_this.saxParser.ended) {
|
||||
_this.saxParser.ended = true;
|
||||
@@ -28325,7 +28325,7 @@ var require_parser = __commonJS({
|
||||
stack = [];
|
||||
attrkey = this.options.attrkey;
|
||||
charkey = this.options.charkey;
|
||||
this.saxParser.onopentag = function(_this) {
|
||||
this.saxParser.onopentag = /* @__PURE__ */ function(_this) {
|
||||
return function(node) {
|
||||
var key, newValue, obj, processedKey, ref;
|
||||
obj = /* @__PURE__ */ Object.create(null);
|
||||
@@ -28357,7 +28357,7 @@ var require_parser = __commonJS({
|
||||
return stack.push(obj);
|
||||
};
|
||||
}(this);
|
||||
this.saxParser.onclosetag = function(_this) {
|
||||
this.saxParser.onclosetag = /* @__PURE__ */ function(_this) {
|
||||
return function() {
|
||||
var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
|
||||
obj = stack.pop();
|
||||
@@ -28456,7 +28456,7 @@ var require_parser = __commonJS({
|
||||
}
|
||||
};
|
||||
}(this);
|
||||
ontext = function(_this) {
|
||||
ontext = /* @__PURE__ */ function(_this) {
|
||||
return function(text) {
|
||||
var charChild, s;
|
||||
s = stack[stack.length - 1];
|
||||
@@ -28478,7 +28478,7 @@ var require_parser = __commonJS({
|
||||
};
|
||||
}(this);
|
||||
this.saxParser.ontext = ontext;
|
||||
return this.saxParser.oncdata = function(_this) {
|
||||
return this.saxParser.oncdata = /* @__PURE__ */ function(_this) {
|
||||
return function(text) {
|
||||
var s;
|
||||
s = ontext(text);
|
||||
@@ -28524,7 +28524,7 @@ var require_parser = __commonJS({
|
||||
}
|
||||
};
|
||||
Parser2.prototype.parseStringPromise = function(str) {
|
||||
return new Promise(function(_this) {
|
||||
return new Promise(/* @__PURE__ */ function(_this) {
|
||||
return function(resolve, reject) {
|
||||
return _this.parseString(str, function(err, value) {
|
||||
if (err) {
|
||||
@@ -30407,7 +30407,7 @@ var init_context = __esm({
|
||||
"node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/context/context.js"() {
|
||||
"use strict";
|
||||
BaseContext = /** @class */
|
||||
function() {
|
||||
/* @__PURE__ */ function() {
|
||||
function BaseContext2(parentContext) {
|
||||
var self2 = this;
|
||||
self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
||||
@@ -57388,7 +57388,7 @@ var import_process = require("process");
|
||||
var import_fs = require("fs");
|
||||
var core = __toESM(require_core());
|
||||
|
||||
// node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs
|
||||
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
||||
var util;
|
||||
(function(util4) {
|
||||
util4.assertEqual = (val) => val;
|
||||
@@ -58129,10 +58129,11 @@ var ZodType = class {
|
||||
};
|
||||
var cuidRegex = /^c[^\s-]{8,}$/i;
|
||||
var cuid2Regex = /^[a-z][a-z0-9]*$/;
|
||||
var ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;
|
||||
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
||||
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
||||
var emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
||||
var emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
|
||||
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
||||
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
||||
var emojiRegex;
|
||||
var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
|
||||
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
||||
var datetimeRegex = (args) => {
|
||||
@@ -58166,27 +58167,6 @@ function isValidIP(ip, version3) {
|
||||
return false;
|
||||
}
|
||||
var ZodString = class _ZodString extends ZodType {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
||||
validation,
|
||||
code: ZodIssueCode.invalid_string,
|
||||
...errorUtil.errToObj(message)
|
||||
});
|
||||
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
||||
this.trim = () => new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "trim" }]
|
||||
});
|
||||
this.toLowerCase = () => new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
||||
});
|
||||
this.toUpperCase = () => new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
||||
});
|
||||
}
|
||||
_parse(input) {
|
||||
if (this._def.coerce) {
|
||||
input.data = String(input.data);
|
||||
@@ -58271,6 +58251,9 @@ var ZodString = class _ZodString extends ZodType {
|
||||
status.dirty();
|
||||
}
|
||||
} else if (check.kind === "emoji") {
|
||||
if (!emojiRegex) {
|
||||
emojiRegex = new RegExp(_emojiRegex, "u");
|
||||
}
|
||||
if (!emojiRegex.test(input.data)) {
|
||||
ctx = this._getOrReturnCtx(input, ctx);
|
||||
addIssueToContext(ctx, {
|
||||
@@ -58407,6 +58390,13 @@ var ZodString = class _ZodString extends ZodType {
|
||||
}
|
||||
return { status: status.value, value: input.data };
|
||||
}
|
||||
_regex(regex, validation, message) {
|
||||
return this.refinement((data) => regex.test(data), {
|
||||
validation,
|
||||
code: ZodIssueCode.invalid_string,
|
||||
...errorUtil.errToObj(message)
|
||||
});
|
||||
}
|
||||
_addCheck(check) {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
@@ -58504,6 +58494,31 @@ var ZodString = class _ZodString extends ZodType {
|
||||
...errorUtil.errToObj(message)
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @deprecated Use z.string().min(1) instead.
|
||||
* @see {@link ZodString.min}
|
||||
*/
|
||||
nonempty(message) {
|
||||
return this.min(1, errorUtil.errToObj(message));
|
||||
}
|
||||
trim() {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "trim" }]
|
||||
});
|
||||
}
|
||||
toLowerCase() {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
||||
});
|
||||
}
|
||||
toUpperCase() {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
||||
});
|
||||
}
|
||||
get isDatetime() {
|
||||
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
||||
}
|
||||
@@ -61034,12 +61049,11 @@ var inferOptions = (inputs) => {
|
||||
const logLevel = inputs.logLevel ?? (core.isDebug() ? "vv" : "default");
|
||||
const manifestPath = inputs.manifestPath ? import_path.default.resolve(untildify(inputs.manifestPath)) : "pixi.toml";
|
||||
const pixiLockFile = import_path.default.join(import_path.default.dirname(manifestPath), import_path.default.basename(manifestPath).replace(/\.toml$/, ".lock"));
|
||||
const cache2 = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
|
||||
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
|
||||
const pixiRunShell = import_path.default.join(import_path.default.dirname(pixiBinPath), "pixi-shell");
|
||||
const frozen = inputs.frozen ?? false;
|
||||
const lockFileAvailable = (0, import_fs.existsSync)(pixiLockFile);
|
||||
core.debug(`lockFileAvailable: ${lockFileAvailable}`);
|
||||
const cache2 = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache === true || lockFileAvailable && inputs.cache !== false ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
|
||||
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
|
||||
const frozen = inputs.frozen ?? false;
|
||||
const locked = inputs.locked ?? (lockFileAvailable && !frozen);
|
||||
const auth = !inputs.authHost ? void 0 : inputs.authToken ? {
|
||||
host: inputs.authHost,
|
||||
@@ -61063,7 +61077,6 @@ var inferOptions = (inputs) => {
|
||||
locked,
|
||||
cache: cache2,
|
||||
pixiBinPath,
|
||||
pixiRunShell,
|
||||
auth,
|
||||
postCleanup
|
||||
};
|
||||
@@ -61215,7 +61228,17 @@ var import_promises = __toESM(require("fs/promises"));
|
||||
var import_path2 = __toESM(require("path"));
|
||||
var core3 = __toESM(require_core());
|
||||
var cache = __toESM(require_cache());
|
||||
var generateCacheKey = async (cacheKeyPrefix) => import_promises.default.readFile(options.pixiLockFile, "utf-8").then((content) => `${cacheKeyPrefix}${getCondaArch()}-${sha256(content)}`).catch((err) => {
|
||||
var generateCacheKey = async (cacheKeyPrefix) => Promise.all([import_promises.default.readFile(options.pixiLockFile), import_promises.default.readFile(options.pixiBinPath)]).then(([lockfileContent, pixiBinary]) => {
|
||||
const lockfileSha = sha256(lockfileContent);
|
||||
core3.debug(`lockfileSha: ${lockfileSha}`);
|
||||
const pixiSha = sha256(pixiBinary);
|
||||
core3.debug(`pixiSha: ${pixiSha}`);
|
||||
const lockfilePathSha = sha256(options.pixiLockFile);
|
||||
core3.debug(`lockfilePathSha: ${lockfilePathSha}`);
|
||||
const sha = sha256(lockfileSha + lockfilePathSha + pixiSha);
|
||||
core3.debug(`sha: ${sha}`);
|
||||
return `${cacheKeyPrefix}${getCondaArch()}-${sha}`;
|
||||
}).catch((err) => {
|
||||
throw new Error(`Failed to generate cache key: ${err}`);
|
||||
});
|
||||
var cachePath = import_path2.default.join(import_path2.default.dirname(options.pixiLockFile), ".pixi");
|
||||
|
||||
+43
-30
@@ -2255,7 +2255,7 @@ var import_process = require("process");
|
||||
var import_fs = require("fs");
|
||||
var core = __toESM(require_core());
|
||||
|
||||
// node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs
|
||||
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
||||
var util;
|
||||
(function(util2) {
|
||||
util2.assertEqual = (val) => val;
|
||||
@@ -2996,10 +2996,11 @@ var ZodType = class {
|
||||
};
|
||||
var cuidRegex = /^c[^\s-]{8,}$/i;
|
||||
var cuid2Regex = /^[a-z][a-z0-9]*$/;
|
||||
var ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;
|
||||
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
||||
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
||||
var emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
||||
var emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
|
||||
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
||||
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
||||
var emojiRegex;
|
||||
var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
|
||||
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
||||
var datetimeRegex = (args) => {
|
||||
@@ -3033,27 +3034,6 @@ function isValidIP(ip, version2) {
|
||||
return false;
|
||||
}
|
||||
var ZodString = class _ZodString extends ZodType {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
||||
validation,
|
||||
code: ZodIssueCode.invalid_string,
|
||||
...errorUtil.errToObj(message)
|
||||
});
|
||||
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
||||
this.trim = () => new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "trim" }]
|
||||
});
|
||||
this.toLowerCase = () => new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
||||
});
|
||||
this.toUpperCase = () => new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
||||
});
|
||||
}
|
||||
_parse(input) {
|
||||
if (this._def.coerce) {
|
||||
input.data = String(input.data);
|
||||
@@ -3138,6 +3118,9 @@ var ZodString = class _ZodString extends ZodType {
|
||||
status.dirty();
|
||||
}
|
||||
} else if (check.kind === "emoji") {
|
||||
if (!emojiRegex) {
|
||||
emojiRegex = new RegExp(_emojiRegex, "u");
|
||||
}
|
||||
if (!emojiRegex.test(input.data)) {
|
||||
ctx = this._getOrReturnCtx(input, ctx);
|
||||
addIssueToContext(ctx, {
|
||||
@@ -3274,6 +3257,13 @@ var ZodString = class _ZodString extends ZodType {
|
||||
}
|
||||
return { status: status.value, value: input.data };
|
||||
}
|
||||
_regex(regex, validation, message) {
|
||||
return this.refinement((data) => regex.test(data), {
|
||||
validation,
|
||||
code: ZodIssueCode.invalid_string,
|
||||
...errorUtil.errToObj(message)
|
||||
});
|
||||
}
|
||||
_addCheck(check) {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
@@ -3371,6 +3361,31 @@ var ZodString = class _ZodString extends ZodType {
|
||||
...errorUtil.errToObj(message)
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @deprecated Use z.string().min(1) instead.
|
||||
* @see {@link ZodString.min}
|
||||
*/
|
||||
nonempty(message) {
|
||||
return this.min(1, errorUtil.errToObj(message));
|
||||
}
|
||||
trim() {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "trim" }]
|
||||
});
|
||||
}
|
||||
toLowerCase() {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
||||
});
|
||||
}
|
||||
toUpperCase() {
|
||||
return new _ZodString({
|
||||
...this._def,
|
||||
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
||||
});
|
||||
}
|
||||
get isDatetime() {
|
||||
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
||||
}
|
||||
@@ -5901,12 +5916,11 @@ var inferOptions = (inputs) => {
|
||||
const logLevel = inputs.logLevel ?? (core.isDebug() ? "vv" : "default");
|
||||
const manifestPath = inputs.manifestPath ? import_path.default.resolve(untildify(inputs.manifestPath)) : "pixi.toml";
|
||||
const pixiLockFile = import_path.default.join(import_path.default.dirname(manifestPath), import_path.default.basename(manifestPath).replace(/\.toml$/, ".lock"));
|
||||
const cache = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
|
||||
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
|
||||
const pixiRunShell = import_path.default.join(import_path.default.dirname(pixiBinPath), "pixi-shell");
|
||||
const frozen = inputs.frozen ?? false;
|
||||
const lockFileAvailable = (0, import_fs.existsSync)(pixiLockFile);
|
||||
core.debug(`lockFileAvailable: ${lockFileAvailable}`);
|
||||
const cache = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache === true || lockFileAvailable && inputs.cache !== false ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
|
||||
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
|
||||
const frozen = inputs.frozen ?? false;
|
||||
const locked = inputs.locked ?? (lockFileAvailable && !frozen);
|
||||
const auth = !inputs.authHost ? void 0 : inputs.authToken ? {
|
||||
host: inputs.authHost,
|
||||
@@ -5930,7 +5944,6 @@ var inferOptions = (inputs) => {
|
||||
locked,
|
||||
cache,
|
||||
pixiBinPath,
|
||||
pixiRunShell,
|
||||
auth,
|
||||
postCleanup
|
||||
};
|
||||
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-pixi",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.2",
|
||||
"private": true,
|
||||
"description": "Action to set up the pixi package manager.",
|
||||
"scripts": {
|
||||
@@ -27,21 +27,21 @@
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"untildify": "^5.0.0",
|
||||
"zod": "^3.22.2"
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
||||
"@typescript-eslint/parser": "^6.7.3",
|
||||
"eslint": "^8.50.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"@types/node": "^20.10.6",
|
||||
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
||||
"@typescript-eslint/parser": "^6.16.0",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-n": "^16.1.0",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-n": "^16.6.0",
|
||||
"eslint-plugin-prettier": "^5.1.2",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"prettier": "^3.0.3",
|
||||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.2.2"
|
||||
"prettier": "^3.1.1",
|
||||
"tsup": "^8.0.1",
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+618
-594
File diff suppressed because it is too large
Load Diff
+14
-3
@@ -6,9 +6,20 @@ import { options } from './options'
|
||||
import { getCondaArch, sha256 } from './util'
|
||||
|
||||
export const generateCacheKey = async (cacheKeyPrefix: string) =>
|
||||
fs
|
||||
.readFile(options.pixiLockFile, 'utf-8')
|
||||
.then((content) => `${cacheKeyPrefix}${getCondaArch()}-${sha256(content)}`)
|
||||
Promise.all([fs.readFile(options.pixiLockFile), fs.readFile(options.pixiBinPath)])
|
||||
.then(([lockfileContent, pixiBinary]) => {
|
||||
const lockfileSha = sha256(lockfileContent)
|
||||
core.debug(`lockfileSha: ${lockfileSha}`)
|
||||
const pixiSha = sha256(pixiBinary)
|
||||
core.debug(`pixiSha: ${pixiSha}`)
|
||||
// the path to the lock file decides where the pixi env is created (../.pixi/env)
|
||||
// since conda envs are not relocatable, we need to include the path in the cache key
|
||||
const lockfilePathSha = sha256(options.pixiLockFile)
|
||||
core.debug(`lockfilePathSha: ${lockfilePathSha}`)
|
||||
const sha = sha256(lockfileSha + lockfilePathSha + pixiSha)
|
||||
core.debug(`sha: ${sha}`)
|
||||
return `${cacheKeyPrefix}${getCondaArch()}-${sha}`
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new Error(`Failed to generate cache key: ${err}`)
|
||||
})
|
||||
|
||||
+18
-21
@@ -64,7 +64,6 @@ export type Options = Readonly<{
|
||||
locked: boolean
|
||||
cache?: Cache
|
||||
pixiBinPath: string
|
||||
pixiRunShell: string
|
||||
auth?: Auth
|
||||
postCleanup: boolean
|
||||
}>
|
||||
@@ -150,21 +149,20 @@ const inferOptions = (inputs: Inputs): Options => {
|
||||
const pixiSource = inputs.pixiVersion
|
||||
? { version: inputs.pixiVersion }
|
||||
: inputs.pixiUrl
|
||||
? { url: inputs.pixiUrl }
|
||||
: { version: 'latest' }
|
||||
? { url: inputs.pixiUrl }
|
||||
: { version: 'latest' }
|
||||
const logLevel = inputs.logLevel ?? (core.isDebug() ? 'vv' : 'default')
|
||||
const manifestPath = inputs.manifestPath ? path.resolve(untildify(inputs.manifestPath)) : 'pixi.toml'
|
||||
const pixiLockFile = path.join(path.dirname(manifestPath), path.basename(manifestPath).replace(/\.toml$/, '.lock'))
|
||||
const cache = inputs.cacheKey
|
||||
? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true }
|
||||
: inputs.cache
|
||||
? { cacheKeyPrefix: 'pixi-', cacheWrite: true }
|
||||
: undefined
|
||||
const pixiBinPath = inputs.pixiBinPath ? path.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin
|
||||
const pixiRunShell = path.join(path.dirname(pixiBinPath), 'pixi-shell')
|
||||
const frozen = inputs.frozen ?? false
|
||||
const lockFileAvailable = existsSync(pixiLockFile)
|
||||
core.debug(`lockFileAvailable: ${lockFileAvailable}`)
|
||||
const cache = inputs.cacheKey
|
||||
? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true }
|
||||
: inputs.cache === true || (lockFileAvailable && inputs.cache !== false)
|
||||
? { cacheKeyPrefix: 'pixi-', cacheWrite: true }
|
||||
: undefined
|
||||
const pixiBinPath = inputs.pixiBinPath ? path.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin
|
||||
const frozen = inputs.frozen ?? false
|
||||
const locked = inputs.locked ?? (lockFileAvailable && !frozen)
|
||||
const auth = !inputs.authHost
|
||||
? undefined
|
||||
@@ -174,15 +172,15 @@ const inferOptions = (inputs: Inputs): Options => {
|
||||
token: inputs.authToken
|
||||
}
|
||||
: inputs.authCondaToken
|
||||
? {
|
||||
host: inputs.authHost,
|
||||
condaToken: inputs.authCondaToken
|
||||
}
|
||||
: {
|
||||
host: inputs.authHost,
|
||||
username: inputs.authUsername!,
|
||||
password: inputs.authPassword!
|
||||
}) as Auth)
|
||||
? {
|
||||
host: inputs.authHost,
|
||||
condaToken: inputs.authCondaToken
|
||||
}
|
||||
: {
|
||||
host: inputs.authHost,
|
||||
username: inputs.authUsername!,
|
||||
password: inputs.authPassword!
|
||||
}) as Auth)
|
||||
const postCleanup = inputs.postCleanup ?? true
|
||||
return {
|
||||
pixiSource,
|
||||
@@ -194,7 +192,6 @@ const inferOptions = (inputs: Inputs): Options => {
|
||||
locked,
|
||||
cache,
|
||||
pixiBinPath,
|
||||
pixiRunShell,
|
||||
auth,
|
||||
postCleanup
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user