mirror of
https://github.com/prefix-dev/setup-pixi
synced 2026-10-08 15:04:08 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccc5c07ed9 | ||
|
|
69d34221c7 | ||
|
|
f5fc2c8748 | ||
|
|
b4f12ad354 | ||
|
|
cc9010b767 | ||
|
|
ed6036947b | ||
|
|
28e30101b7 | ||
|
|
557d81653f | ||
|
|
a784a3155d | ||
|
|
f19fc8f1fd | ||
|
|
b6cda42ffe | ||
|
|
5eaef48d51 | ||
|
|
fbf0d0d598 | ||
|
|
e2bb9e2af8 | ||
|
|
041b177283 | ||
|
|
c2b1b0900e | ||
|
|
fa1893576e | ||
|
|
2d8ad6d40b | ||
|
|
3386b66ca6 | ||
|
|
f2b00643d1 | ||
|
|
baaee6ddca | ||
|
|
0588e20b3b | ||
|
|
cd462a6dae | ||
|
|
1004096c21 | ||
|
|
3416289b3a | ||
|
|
4a577033f0 | ||
|
|
9f7faaabfb | ||
|
|
f6701cc41d | ||
|
|
1a516323cb | ||
|
|
b1283a4612 | ||
|
|
e250ab868e |
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
+9
-6
@@ -3,21 +3,24 @@ changelog:
|
||||
labels:
|
||||
- ignore for release
|
||||
categories:
|
||||
- title: New features
|
||||
- title: 💥 Breaking changes
|
||||
labels:
|
||||
- breaking
|
||||
- title: ✨ New features
|
||||
labels:
|
||||
- enhancement
|
||||
- title: CI
|
||||
- title: 👷🏻 CI
|
||||
labels:
|
||||
- ci
|
||||
- title: Bug fixes
|
||||
- title: 🐛 Bug fixes
|
||||
labels:
|
||||
- bug
|
||||
- title: Documentation
|
||||
- title: 📝 Documentation
|
||||
labels:
|
||||
- documentation
|
||||
- title: Dependency updates
|
||||
- title: ⬆️ Dependency updates
|
||||
labels:
|
||||
- dependencies
|
||||
- title: Other changes
|
||||
- title: 🤷🏻 Other changes
|
||||
labels:
|
||||
- "*"
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
version: 8
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
version: 8
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Quantco/ui-actions/version-metadata@v1
|
||||
id: version-metadata
|
||||
with:
|
||||
|
||||
+427
-58
@@ -9,19 +9,43 @@ on:
|
||||
|
||||
jobs:
|
||||
default:
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
test -f .pixi/env/bin/python
|
||||
./.pixi/env/bin/python --version | grep -q 3.11
|
||||
shell: bash
|
||||
if: matrix.os != 'windows-latest'
|
||||
- run: |
|
||||
set -o pipefail
|
||||
pixi info
|
||||
test -f .pixi/env/python.exe
|
||||
./.pixi/env/python.exe --version | grep -q 3.11
|
||||
shell: bash
|
||||
if: matrix.os == 'windows-latest'
|
||||
- run: |
|
||||
pixi run python --version | grep -q 3.11
|
||||
pixi run test | grep -q "Hello world"
|
||||
|
||||
no-run-install:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
@@ -29,20 +53,58 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
run-install: false
|
||||
cache: false
|
||||
- run: |
|
||||
! test -d .pixi
|
||||
shell: bash
|
||||
|
||||
custom-pixi-version:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
pixi-version: v0.1.0
|
||||
# pixi 0.1.0 doesn't support --locked
|
||||
locked: false
|
||||
- run: pixi --version | grep -q "pixi 0.1.0"
|
||||
|
||||
frozen:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
frozen: true
|
||||
- run: pixi run python --version | grep -q 3.11
|
||||
|
||||
locked:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
locked: true
|
||||
- run: pixi run python --version | grep -q 3.11
|
||||
|
||||
custom-pixi-url:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -51,21 +113,28 @@ 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:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
manifest-path: test/default/pixi.toml
|
||||
|
||||
different-log-level:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -73,49 +142,50 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
log-level: debug
|
||||
|
||||
# run-shell:
|
||||
# strategy:
|
||||
# matrix:
|
||||
# os: [ubuntu-latest, macos-latest]
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi.toml
|
||||
# run: mv test/default/* .
|
||||
# - uses: ./
|
||||
# with:
|
||||
# generate-run-shell: true
|
||||
# - run: python --version | grep -q "3.11"
|
||||
# shell: pixi-shell {0}
|
||||
cache: false
|
||||
log-level: v
|
||||
|
||||
custom-bin-path:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- name: Create bin directory
|
||||
run: mkdir bin
|
||||
- uses: ./
|
||||
with:
|
||||
pixi-bin-path: bin/pixi
|
||||
cache: false
|
||||
pixi-bin-path: custom-bin/pixi${{ matrix.os == 'windows-latest' && '.exe' || '' }}
|
||||
- run: |
|
||||
which pixi | grep -q "..."
|
||||
test -f custom-bin/pixi${{ matrix.os == 'windows-latest' && '.exe' || '' }}
|
||||
pixi --help
|
||||
which pixi | grep -q custom-bin/pixi
|
||||
# which pixi should be absolute
|
||||
which pixi | grep -q "^/"
|
||||
|
||||
auth-token:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
auth-host: TODO
|
||||
auth-token: TODO
|
||||
# TODO
|
||||
# - run:
|
||||
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
|
||||
# all other platforms have the credentials stored in the keychain
|
||||
# https://github.com/prefix-dev/pixi/issues/330
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
||||
auth-username-password:
|
||||
strategy:
|
||||
@@ -128,41 +198,86 @@ jobs:
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
auth-host: TODO
|
||||
auth-username: TODO
|
||||
auth-password: TODO
|
||||
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
|
||||
# all other platforms have the credentials stored in the keychain
|
||||
# https://github.com/prefix-dev/pixi/issues/330
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
||||
auth-conda-token:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
auth-host: TODO
|
||||
auth-conda-token: TODO
|
||||
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
|
||||
# all other platforms have the credentials stored in the keychain
|
||||
# https://github.com/prefix-dev/pixi/issues/330
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
||||
post-cleanup:
|
||||
# not implemented yet
|
||||
if: false
|
||||
name: post-cleanup ${{ matrix.post-cleanup }}
|
||||
auth-token-install:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
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
|
||||
run: |
|
||||
test -f .pixi/env/conda-meta/private-package-0.0.1-0.json
|
||||
|
||||
pixi-shell:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
- run: |
|
||||
python --version | grep -q "3.11"
|
||||
shell: pixi run bash {0}
|
||||
- run: |
|
||||
import sys
|
||||
print(sys.version)
|
||||
print("Hello world")
|
||||
shell: pixi run python {0}
|
||||
|
||||
post-cleanup-linux:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- post-cleanup: 'none'
|
||||
env-exists: ''
|
||||
cache-exists: ''
|
||||
pixi-dir-exists: ''
|
||||
- post-cleanup: 'environment'
|
||||
env-exists: '! '
|
||||
cache-exists: ''
|
||||
pixi-dir-exists: ''
|
||||
- post-cleanup: 'all'
|
||||
env-exists: '! '
|
||||
cache-exists: '! '
|
||||
pixi-dir-exists: '! '
|
||||
post-cleanup: ['true', 'false']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
@@ -171,21 +286,275 @@ jobs:
|
||||
with:
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
${{ matrix.env-exists }}test -d .pixi
|
||||
${{ matrix.cache-exists }}test -d ~/.cache/rattler
|
||||
${{ matrix.pixi-dir-exists }}test -f ~/.pixi
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d .pixi
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d ~/.rattler
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d ~/.cache/rattler
|
||||
${{ 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
|
||||
auth-token: custom-token
|
||||
|
||||
post-cleanup-linux-no-login:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
post-cleanup: ['true', 'false']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: lisanna-dettwyler/action-post-run@d053b9b43d788b87a409f6cdb3b6fc87c6c8a4fe
|
||||
with:
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d .pixi
|
||||
! test -d ~/.rattler
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d ~/.cache/rattler
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
|
||||
post-cleanup-macos:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
post-cleanup: ['true', 'false']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: lisanna-dettwyler/action-post-run@d053b9b43d788b87a409f6cdb3b6fc87c6c8a4fe
|
||||
with:
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d .pixi
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d ~/Library/Caches/rattler
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
|
||||
post-cleanup-windows:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
post-cleanup: ['true', 'false']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/default/* .
|
||||
- uses: lisanna-dettwyler/action-post-run@d053b9b43d788b87a409f6cdb3b6fc87c6c8a4fe
|
||||
with:
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d .pixi
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -d "$LOCALAPPDATA/rattler"
|
||||
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
|
||||
- uses: ./
|
||||
with:
|
||||
cache: false
|
||||
post-cleanup: ${{ matrix.post-cleanup }}
|
||||
|
||||
no-lockfile:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi.toml
|
||||
run: mv test/no-lockfile/* .
|
||||
- uses: ./
|
||||
- run: |
|
||||
set -o pipefail
|
||||
pixi info
|
||||
test -f .pixi/env/bin/python
|
||||
./.pixi/env/bin/python --version | grep -q 3.11
|
||||
shell: bash
|
||||
if: matrix.os != 'windows-latest'
|
||||
- run: |
|
||||
set -o pipefail
|
||||
pixi info
|
||||
test -f .pixi/env/python.exe
|
||||
./.pixi/env/python.exe --version | grep -q 3.11
|
||||
shell: bash
|
||||
if: matrix.os == 'windows-latest'
|
||||
- run: |
|
||||
pixi run python --version | grep -q 3.11
|
||||
pixi run test | grep -q "Hello world"
|
||||
|
||||
test-cache1:
|
||||
name: Test cache 1/2
|
||||
timeout-minutes: 10
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi files
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: true
|
||||
cache-key: test-cache-${{ github.sha }}-${{ github.run_attempt }}-
|
||||
# check the action logs to see if the cache was written
|
||||
- run: |
|
||||
test -f .pixi/env/bin/python
|
||||
if: matrix.os != 'windows-latest'
|
||||
- run: |
|
||||
test -f .pixi/env/python.exe
|
||||
if: matrix.os == 'windows-latest'
|
||||
|
||||
test-cache2:
|
||||
name: Test cache 2/2
|
||||
timeout-minutes: 10
|
||||
needs: test-cache1
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi files
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: true
|
||||
cache-key: test-cache-${{ github.sha }}-${{ github.run_attempt }}-
|
||||
# check the action logs to see if the cache was restored
|
||||
- run: |
|
||||
test -f .pixi/env/bin/python
|
||||
if: matrix.os != 'windows-latest'
|
||||
- run: |
|
||||
test -f .pixi/env/python.exe
|
||||
if: matrix.os == 'windows-latest'
|
||||
|
||||
test-cache-no-write:
|
||||
name: Test cache no write
|
||||
timeout-minutes: 10
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Move pixi files
|
||||
run: mv test/default/* .
|
||||
- uses: ./
|
||||
with:
|
||||
cache: true
|
||||
cache-write: false
|
||||
cache-key: test-cache-${{ github.sha }}-${{ github.run_attempt }}-
|
||||
# check the action logs to see if the cache write was skipped
|
||||
|
||||
# not properly testable
|
||||
# https://github.com/actions/runner/issues/2347
|
||||
# https://github.com/orgs/community/discussions/15452
|
||||
# test-cache-fail-no-lockfile:
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi files
|
||||
# run: mv test/no-lockfile/* .
|
||||
# - uses: ./
|
||||
# with:
|
||||
# cache: true
|
||||
# cache-key: test-cache-no-lockfile-${{ github.sha }}-${{ github.run_attempt }}-
|
||||
# - run: exit 1
|
||||
# if: success()
|
||||
|
||||
# test-incorrect-version:
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi files
|
||||
# run: mv test/default/* .
|
||||
# - uses: ./
|
||||
# with:
|
||||
# pixi-version: 0.1.0
|
||||
# - run: exit 1
|
||||
# if: success()
|
||||
|
||||
# test-frozen-and-locked:
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi files
|
||||
# run: mv test/default/* .
|
||||
# - uses: ./
|
||||
# with:
|
||||
# pixi-version: v0.5.0
|
||||
# frozen: true
|
||||
# locked: true
|
||||
# - run: exit 1
|
||||
# if: success()
|
||||
|
||||
# test-frozen-no-lockfile:
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi files
|
||||
# run: mv test/no-lockfile/* .
|
||||
# - uses: ./
|
||||
# with:
|
||||
# frozen: true
|
||||
# - run: exit 1
|
||||
# if: success()
|
||||
|
||||
# test-locked-no-lockfile:
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi files
|
||||
# run: mv test/no-lockfile/* .
|
||||
# - uses: ./
|
||||
# with:
|
||||
# locked: true
|
||||
# - run: exit 1
|
||||
# if: success()
|
||||
|
||||
# test-lockfile-not-up-to-date:
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Move pixi files
|
||||
# run: mv test/lockfile-not-up-to-date/* .
|
||||
# - uses: ./
|
||||
# # locked: true is implicit
|
||||
# - run: exit 1
|
||||
# if: success()
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
<h1 align="center">
|
||||
|
||||
[![License][license-badge]][license]
|
||||
[![CI][build-badge]][build]
|
||||
[![Latest release][latest-release-badge]][releases]
|
||||
[![Project Chat][chat-badge]][chat-url]
|
||||
|
||||
[license-badge]: https://img.shields.io/github/license/prefix-dev/setup-pixi?style=flat-square
|
||||
[license]: ./LICENSE
|
||||
[build-badge]: https://img.shields.io/github/actions/workflow/status/prefix-dev/setup-pixi/test.yml?style=flat-square
|
||||
[build]: https://github.com/prefix-dev/setup-pixi/actions/
|
||||
[latest-release-badge]: https://img.shields.io/github/v/tag/prefix-dev/setup-pixi?style=flat-square&label=latest&sort=semver
|
||||
[releases]: https://github.com/prefix-dev/setup-pixi/releases
|
||||
[chat-badge]: https://img.shields.io/discord/1082332781146800168.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square
|
||||
[chat-url]: https://discord.gg/kKV8ZxyzY4
|
||||
|
||||
</h1>
|
||||
|
||||
# setup-pixi 📦
|
||||
|
||||
GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package manager.
|
||||
|
||||
## Usage
|
||||
|
||||
```yml
|
||||
- uses: prefix-dev/setup-pixi@v0.3.0
|
||||
with:
|
||||
pixi-version: v0.5.0
|
||||
cache: true
|
||||
auth-host: prefix.dev
|
||||
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
|
||||
- run: pixi run test
|
||||
```
|
||||
|
||||
> [!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.
|
||||
> 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).
|
||||
|
||||
## Features
|
||||
|
||||
To see all available input arguments, see the [`action.yml`](action.yml) file.
|
||||
|
||||
### Caching
|
||||
|
||||
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>`.
|
||||
|
||||
### Authentication
|
||||
|
||||
There are currently three ways to authenticate with pixi:
|
||||
|
||||
- using a token
|
||||
- using a username and password
|
||||
- using a conda-token
|
||||
|
||||
For more information, see the [pixi documentation](https://prefix.dev/docs/pixi/authentication).
|
||||
|
||||
> [!WARNING]
|
||||
> Please only store sensitive information using [GitHub secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions). Do not store them in your repository.
|
||||
> When your sensitive information is stored in a GitHub secret, you can access it using the `${{ secrets.SECRET_NAME }}` syntax.
|
||||
> These secrets will always be masked in the logs.
|
||||
|
||||
#### Token
|
||||
|
||||
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
|
||||
with:
|
||||
auth-host: prefix.dev
|
||||
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
|
||||
```
|
||||
|
||||
#### Username and password
|
||||
|
||||
Specify the username and password using the `auth-username` and `auth-password` input arguments.
|
||||
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
|
||||
with:
|
||||
auth-host: custom-artifactory.com
|
||||
auth-username: ${{ secrets.PIXI_USERNAME }}
|
||||
auth-password: ${{ secrets.PIXI_PASSWORD }}
|
||||
```
|
||||
|
||||
#### Conda-token
|
||||
|
||||
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
|
||||
with:
|
||||
auth-host: anaconda.org # or my-quetz-instance.com
|
||||
conda-token: ${{ secrets.CONDA_TOKEN }}
|
||||
```
|
||||
|
||||
### Custom shell wrapper
|
||||
|
||||
`setup-pixi` allows you to run command inside of the pixi environment by specifying a custom shell wrapper with `shell: pixi run bash {0}`.
|
||||
This can be useful if you want to run commands inside of the pixi environment, but don't want to use the `pixi run` command for each command.
|
||||
|
||||
```yml
|
||||
- run: | # everything here will be run inside of the pixi environment
|
||||
python --version
|
||||
pip install -e --no-deps .
|
||||
shell: pixi run bash {0}
|
||||
```
|
||||
|
||||
You can even run python scripts like this:
|
||||
|
||||
```yml
|
||||
- run: | # everything here will be run inside of the pixi environment
|
||||
import my_package
|
||||
print("Hello world!")
|
||||
shell: pixi run python {0}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Under the hood, the `shell: xyz {0}` option is implemented by creating a temporary script file and calling `xyz` with that script file as an argument.
|
||||
> This file does not have the executable bit set, so you cannot use `shell: pixi run {0}` directly but instead have to use `shell: pixi run bash {0}`.
|
||||
> See the [official documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell) and [ADR 0277](https://github.com/actions/runner/blob/main/docs/adrs/0277-run-action-shell-options.md) for more information about how the `shell:` input works in GitHub Actions.
|
||||
|
||||
### `--frozen` and `--locked`
|
||||
|
||||
You can specify whether `setup-pixi` should run `pixi install --frozen` or `pixi install --locked` depending on the `frozen` or the `locked` input argument.
|
||||
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
|
||||
with:
|
||||
locked: true
|
||||
# or
|
||||
frozen: true
|
||||
```
|
||||
|
||||
If you don't specify anything, the default behavior is to run `pixi install --locked` if a `pixi.lock` file is present and `pixi install` otherwise.
|
||||
|
||||
### Debugging
|
||||
|
||||
There are two types of debug logging that you can enable.
|
||||
|
||||
#### Debug logging of the action
|
||||
|
||||
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
|
||||
env:
|
||||
RUNNER_DEBUG: true
|
||||
```
|
||||
|
||||
Alternatively, you can enable debug logging for the action by re-running the action in debug mode:
|
||||
|
||||

|
||||

|
||||
|
||||
> For more information about debug logging in GitHub Actions, see [the official documentation](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging).
|
||||
|
||||
#### Debug logging of pixi
|
||||
|
||||
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
|
||||
with:
|
||||
# one of `q`, `default`, `v`, `vv`, or `vvv`.
|
||||
log-level: vvv
|
||||
```
|
||||
|
||||
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).
|
||||
|
||||
### Self-hosted runners
|
||||
|
||||
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).
|
||||
|
||||
If you set `post-cleanup` to `true`, the action will delete the following files:
|
||||
|
||||
- `.pixi` environment
|
||||
- the pixi binary
|
||||
- the rattler cache
|
||||
- other rattler files in `~/.rattler`
|
||||
|
||||
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
|
||||
with:
|
||||
post-cleanup: true
|
||||
# ${{ runner.temp }}\Scripts\pixi.exe on Windows
|
||||
pixi-bin-path: ${{ runner.temp }}/bin/pixi
|
||||
```
|
||||
|
||||
## More examples
|
||||
|
||||
If you want to see more examples, you can take a look at the [GitHub Workflows of this repository](.github/workflows/test.yml).
|
||||
|
||||
## Local Development
|
||||
|
||||
1. Clone this repository.
|
||||
1. Run `pnpm install` inside the repository (if you don't have [`pnpm`](https://github.com/pnpm/pnpm) installed, you can install it with `npm install -g pnpm` or `brew install pnpm`).
|
||||
1. Run `pnpm dev` for live transpilation of the TypeScript source code.
|
||||
1. To test the action, you can run [`act`](https://github.com/nektos/act) (inside docker) or use :sparkles: CI driven development :sparkles:.
|
||||
+11
-11
@@ -13,20 +13,24 @@ inputs:
|
||||
log-level:
|
||||
description: |
|
||||
Log level for the pixi CLI.
|
||||
One of `quiet`, `warn`, `info`, `debug`, or `trace`.
|
||||
One of `q`, `default`, `v`, `vv`, or `vvv`.
|
||||
manifest-path:
|
||||
description: Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`.
|
||||
run-install:
|
||||
description: Whether to run `pixi install` after setting up the environment. Defaults to `true`.
|
||||
generate-run-shell:
|
||||
description: |
|
||||
Whether to generate a custom shell script that allows to use it in the workflow file using `run: pixi-shell {0}`.
|
||||
locked:
|
||||
description: Whether to use `pixi install --locked`. Defaults to `true` when the lockfile is present, otherwise `false`.
|
||||
frozen:
|
||||
description: Whether to use `pixi install --frozen`. Defaults to `false`.
|
||||
cache:
|
||||
description: Whether to cache the pixi environment. Defaults to `true`. Only works if `pixi.lock` is present.
|
||||
cache-key:
|
||||
description: |
|
||||
Cache key prefix to use for caching the pixi environment.
|
||||
Defaults to `pixi-{conda-arch}`.
|
||||
Defaults to `pixi-`. The full cache key is `<cache-key><conda-arch>-<sha-256-of-pixi-lock>`.
|
||||
cache-write:
|
||||
description: |
|
||||
Whether to write to the cache or only read from it. Defaults to `true`.
|
||||
pixi-bin-path:
|
||||
description: |
|
||||
Path to the pixi binary to use. Defaults to `~/.pixi/bin/pixi`.
|
||||
@@ -45,12 +49,8 @@ inputs:
|
||||
description: Conda token to use for authentication.
|
||||
post-cleanup:
|
||||
description: |
|
||||
What kind of cleanup the action should do in the post step.
|
||||
One of `none`, `environment` or `all`.
|
||||
If `none`, no cleanup is done.
|
||||
If `environment`, the pixi environment is removed.
|
||||
If `all`, the pixi environment, the pixi CLI are removed and the rattler cache is cleared.
|
||||
Defaults to `all`.
|
||||
If the action should clean up after itself. Defaults to `true`.
|
||||
If `true`, the pixi environment, the pixi binary and the rattler files in ~/.rattler and ~/.cache/rattler are removed.
|
||||
|
||||
runs:
|
||||
using: node20
|
||||
|
||||
+324
-244
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/utils.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/utils.js
|
||||
var require_utils = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/utils.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/utils.js"(exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.toCommandProperties = exports.toCommandValue = void 0;
|
||||
@@ -65,9 +65,9 @@ var require_utils = __commonJS({
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/command.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/command.js
|
||||
var require_command = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/command.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/command.js"(exports) {
|
||||
"use strict";
|
||||
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
||||
if (k2 === void 0)
|
||||
@@ -99,11 +99,11 @@ var require_command = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.issue = exports.issueCommand = void 0;
|
||||
var os6 = __importStar(require("os"));
|
||||
var os7 = __importStar(require("os"));
|
||||
var utils_1 = require_utils();
|
||||
function issueCommand(command, properties, message) {
|
||||
const cmd = new Command(command, properties, message);
|
||||
process.stdout.write(cmd.toString() + os6.EOL);
|
||||
process.stdout.write(cmd.toString() + os7.EOL);
|
||||
}
|
||||
exports.issueCommand = issueCommand;
|
||||
function issue(name, message = "") {
|
||||
@@ -500,9 +500,9 @@ var init_esm_node = __esm({
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/file-command.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/file-command.js
|
||||
var require_file_command = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/file-command.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/file-command.js"(exports) {
|
||||
"use strict";
|
||||
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
||||
if (k2 === void 0)
|
||||
@@ -535,7 +535,7 @@ var require_file_command = __commonJS({
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
||||
var fs4 = __importStar(require("fs"));
|
||||
var os6 = __importStar(require("os"));
|
||||
var os7 = __importStar(require("os"));
|
||||
var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports));
|
||||
var utils_1 = require_utils();
|
||||
function issueFileCommand(command, message) {
|
||||
@@ -546,7 +546,7 @@ var require_file_command = __commonJS({
|
||||
if (!fs4.existsSync(filePath)) {
|
||||
throw new Error(`Missing file at path: ${filePath}`);
|
||||
}
|
||||
fs4.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os6.EOL}`, {
|
||||
fs4.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os7.EOL}`, {
|
||||
encoding: "utf8"
|
||||
});
|
||||
}
|
||||
@@ -560,7 +560,7 @@ var require_file_command = __commonJS({
|
||||
if (convertedValue.includes(delimiter2)) {
|
||||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter2}"`);
|
||||
}
|
||||
return `${key}<<${delimiter2}${os6.EOL}${convertedValue}${os6.EOL}${delimiter2}`;
|
||||
return `${key}<<${delimiter2}${os7.EOL}${convertedValue}${os7.EOL}${delimiter2}`;
|
||||
}
|
||||
exports.prepareKeyValueMessage = prepareKeyValueMessage;
|
||||
}
|
||||
@@ -1570,9 +1570,9 @@ var require_auth = __commonJS({
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/oidc-utils.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/oidc-utils.js
|
||||
var require_oidc_utils = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/oidc-utils.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/oidc-utils.js"(exports) {
|
||||
"use strict";
|
||||
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) {
|
||||
@@ -1637,7 +1637,7 @@ var require_oidc_utils = __commonJS({
|
||||
|
||||
Error Code : ${error2.statusCode}
|
||||
|
||||
Error Message: ${error2.result.message}`);
|
||||
Error Message: ${error2.message}`);
|
||||
});
|
||||
const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value;
|
||||
if (!id_token) {
|
||||
@@ -1668,9 +1668,9 @@ var require_oidc_utils = __commonJS({
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/summary.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/summary.js
|
||||
var require_summary = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/summary.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/summary.js"(exports) {
|
||||
"use strict";
|
||||
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) {
|
||||
@@ -1962,9 +1962,9 @@ var require_summary = __commonJS({
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/path-utils.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/path-utils.js
|
||||
var require_path_utils = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/path-utils.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/path-utils.js"(exports) {
|
||||
"use strict";
|
||||
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
||||
if (k2 === void 0)
|
||||
@@ -2012,9 +2012,9 @@ var require_path_utils = __commonJS({
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/core.js
|
||||
// node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/core.js
|
||||
var require_core = __commonJS({
|
||||
"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/core.js"(exports) {
|
||||
"node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/core.js"(exports) {
|
||||
"use strict";
|
||||
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
||||
if (k2 === void 0)
|
||||
@@ -2076,7 +2076,7 @@ var require_core = __commonJS({
|
||||
var command_1 = require_command();
|
||||
var file_command_1 = require_file_command();
|
||||
var utils_1 = require_utils();
|
||||
var os6 = __importStar(require("os"));
|
||||
var os7 = __importStar(require("os"));
|
||||
var path4 = __importStar(require("path"));
|
||||
var oidc_utils_1 = require_oidc_utils();
|
||||
var ExitCode;
|
||||
@@ -2144,7 +2144,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
if (filePath) {
|
||||
return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value));
|
||||
}
|
||||
process.stdout.write(os6.EOL);
|
||||
process.stdout.write(os7.EOL);
|
||||
command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value));
|
||||
}
|
||||
exports.setOutput = setOutput;
|
||||
@@ -2152,15 +2152,15 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
command_1.issue("echo", enabled2 ? "on" : "off");
|
||||
}
|
||||
exports.setCommandEcho = setCommandEcho;
|
||||
function setFailed2(message) {
|
||||
function setFailed3(message) {
|
||||
process.exitCode = ExitCode.Failure;
|
||||
error2(message);
|
||||
}
|
||||
exports.setFailed = setFailed2;
|
||||
function isDebug2() {
|
||||
exports.setFailed = setFailed3;
|
||||
function isDebug3() {
|
||||
return process.env["RUNNER_DEBUG"] === "1";
|
||||
}
|
||||
exports.isDebug = isDebug2;
|
||||
exports.isDebug = isDebug3;
|
||||
function debug5(message) {
|
||||
command_1.issueCommand("debug", {}, message);
|
||||
}
|
||||
@@ -2178,7 +2178,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||
}
|
||||
exports.notice = notice;
|
||||
function info3(message) {
|
||||
process.stdout.write(message + os6.EOL);
|
||||
process.stdout.write(message + os7.EOL);
|
||||
}
|
||||
exports.info = info3;
|
||||
function startGroup(name) {
|
||||
@@ -3886,12 +3886,12 @@ var require_manifest = __commonJS({
|
||||
exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
|
||||
var semver = __importStar(require_semver());
|
||||
var core_1 = require_core();
|
||||
var os6 = require("os");
|
||||
var os7 = require("os");
|
||||
var cp = require("child_process");
|
||||
var fs4 = require("fs");
|
||||
function _findMatch(versionSpec, stable, candidates, archFilter) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const platFilter = os6.platform();
|
||||
const platFilter = os7.platform();
|
||||
let result;
|
||||
let match;
|
||||
let file;
|
||||
@@ -3928,7 +3928,7 @@ var require_manifest = __commonJS({
|
||||
}
|
||||
exports._findMatch = _findMatch;
|
||||
function _getOsVersion() {
|
||||
const plat = os6.platform();
|
||||
const plat = os7.platform();
|
||||
let version3 = "";
|
||||
if (plat === "darwin") {
|
||||
version3 = cp.execSync("sw_vers -productVersion").toString();
|
||||
@@ -4101,7 +4101,7 @@ var require_toolrunner = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.argStringToArray = exports.ToolRunner = void 0;
|
||||
var os6 = __importStar(require("os"));
|
||||
var os7 = __importStar(require("os"));
|
||||
var events = __importStar(require("events"));
|
||||
var child = __importStar(require("child_process"));
|
||||
var path4 = __importStar(require("path"));
|
||||
@@ -4156,12 +4156,12 @@ var require_toolrunner = __commonJS({
|
||||
_processLineBuffer(data, strBuffer, onLine) {
|
||||
try {
|
||||
let s = strBuffer + data.toString();
|
||||
let n = s.indexOf(os6.EOL);
|
||||
let n = s.indexOf(os7.EOL);
|
||||
while (n > -1) {
|
||||
const line = s.substring(0, n);
|
||||
onLine(line);
|
||||
s = s.substring(n + os6.EOL.length);
|
||||
n = s.indexOf(os6.EOL);
|
||||
s = s.substring(n + os7.EOL.length);
|
||||
n = s.indexOf(os7.EOL);
|
||||
}
|
||||
return s;
|
||||
} catch (err) {
|
||||
@@ -4330,7 +4330,7 @@ var require_toolrunner = __commonJS({
|
||||
}
|
||||
const optionsNonNull = this._cloneExecOptions(this.options);
|
||||
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os6.EOL);
|
||||
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os7.EOL);
|
||||
}
|
||||
const state = new ExecState(optionsNonNull, this.toolPath);
|
||||
state.on("debug", (message) => {
|
||||
@@ -4816,7 +4816,7 @@ var require_tool_cache = __commonJS({
|
||||
var io = __importStar(require_io());
|
||||
var fs4 = __importStar(require("fs"));
|
||||
var mm = __importStar(require_manifest());
|
||||
var os6 = __importStar(require("os"));
|
||||
var os7 = __importStar(require("os"));
|
||||
var path4 = __importStar(require("path"));
|
||||
var httpm = __importStar(require_lib());
|
||||
var semver = __importStar(require_semver());
|
||||
@@ -5095,7 +5095,7 @@ var require_tool_cache = __commonJS({
|
||||
function cacheDir(sourceDir, tool, version3, arch3) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
version3 = semver.clean(version3) || version3;
|
||||
arch3 = arch3 || os6.arch();
|
||||
arch3 = arch3 || os7.arch();
|
||||
core5.debug(`Caching tool ${tool} ${version3} ${arch3}`);
|
||||
core5.debug(`source dir: ${sourceDir}`);
|
||||
if (!fs4.statSync(sourceDir).isDirectory()) {
|
||||
@@ -5114,7 +5114,7 @@ var require_tool_cache = __commonJS({
|
||||
function cacheFile(sourceFile, targetFile, tool, version3, arch3) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
version3 = semver.clean(version3) || version3;
|
||||
arch3 = arch3 || os6.arch();
|
||||
arch3 = arch3 || os7.arch();
|
||||
core5.debug(`Caching tool ${tool} ${version3} ${arch3}`);
|
||||
core5.debug(`source file: ${sourceFile}`);
|
||||
if (!fs4.statSync(sourceFile).isFile()) {
|
||||
@@ -5136,7 +5136,7 @@ var require_tool_cache = __commonJS({
|
||||
if (!versionSpec) {
|
||||
throw new Error("versionSpec parameter is required");
|
||||
}
|
||||
arch3 = arch3 || os6.arch();
|
||||
arch3 = arch3 || os7.arch();
|
||||
if (!isExplicitVersion(versionSpec)) {
|
||||
const localVersions = findAllVersions(toolName, arch3);
|
||||
const match = evaluateVersions(localVersions, versionSpec);
|
||||
@@ -5159,7 +5159,7 @@ var require_tool_cache = __commonJS({
|
||||
exports.find = find2;
|
||||
function findAllVersions(toolName, arch3) {
|
||||
const versions = [];
|
||||
arch3 = arch3 || os6.arch();
|
||||
arch3 = arch3 || os7.arch();
|
||||
const toolPath = path4.join(_getCacheDirectory(), toolName);
|
||||
if (fs4.existsSync(toolPath)) {
|
||||
const children2 = fs4.readdirSync(toolPath);
|
||||
@@ -5210,7 +5210,7 @@ var require_tool_cache = __commonJS({
|
||||
});
|
||||
}
|
||||
exports.getManifestFromRepo = getManifestFromRepo;
|
||||
function findFromManifest(versionSpec, stable, manifest, archFilter = os6.arch()) {
|
||||
function findFromManifest(versionSpec, stable, manifest, archFilter = os7.arch()) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
|
||||
return match;
|
||||
@@ -6554,7 +6554,7 @@ var require_internal_pattern = __commonJS({
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Pattern = void 0;
|
||||
var os6 = __importStar(require("os"));
|
||||
var os7 = __importStar(require("os"));
|
||||
var path4 = __importStar(require("path"));
|
||||
var pathHelper = __importStar(require_internal_path_helper());
|
||||
var assert_1 = __importDefault(require("assert"));
|
||||
@@ -6647,7 +6647,7 @@ var require_internal_pattern = __commonJS({
|
||||
if (pattern === "." || pattern.startsWith(`.${path4.sep}`)) {
|
||||
pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1);
|
||||
} else if (pattern === "~" || pattern.startsWith(`~${path4.sep}`)) {
|
||||
homedir = homedir || os6.homedir();
|
||||
homedir = homedir || os7.homedir();
|
||||
assert_1.default(homedir, "Unable to determine HOME directory");
|
||||
assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
|
||||
pattern = _Pattern.globEscape(homedir) + pattern.substr(1);
|
||||
@@ -18941,12 +18941,12 @@ var init_sanitizer = __esm({
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@azure+core-http@3.0.3/node_modules/@azure/core-http/dist-esm/src/util/inspect.js
|
||||
var import_util2, custom;
|
||||
var import_util, custom;
|
||||
var init_inspect = __esm({
|
||||
"node_modules/.pnpm/@azure+core-http@3.0.3/node_modules/@azure/core-http/dist-esm/src/util/inspect.js"() {
|
||||
"use strict";
|
||||
import_util2 = require("util");
|
||||
custom = import_util2.inspect.custom;
|
||||
import_util = require("util");
|
||||
custom = import_util.inspect.custom;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18983,14 +18983,14 @@ var init_restError = __esm({
|
||||
|
||||
// node_modules/.pnpm/@azure+logger@1.0.4/node_modules/@azure/logger/dist-esm/src/log.js
|
||||
function log(message, ...args) {
|
||||
process.stderr.write(`${import_util3.default.format(message, ...args)}${import_os2.EOL}`);
|
||||
process.stderr.write(`${import_util2.default.format(message, ...args)}${import_os2.EOL}`);
|
||||
}
|
||||
var import_os2, import_util3;
|
||||
var import_os2, import_util2;
|
||||
var init_log = __esm({
|
||||
"node_modules/.pnpm/@azure+logger@1.0.4/node_modules/@azure/logger/dist-esm/src/log.js"() {
|
||||
"use strict";
|
||||
import_os2 = require("os");
|
||||
import_util3 = __toESM(require("util"));
|
||||
import_util2 = __toESM(require("util"));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22602,9 +22602,9 @@ var init_requestPolicy = __esm({
|
||||
/**
|
||||
* The main method to implement that manipulates a request/response.
|
||||
*/
|
||||
constructor(_nextPolicy, _options) {
|
||||
constructor(_nextPolicy, _options2) {
|
||||
this._nextPolicy = _nextPolicy;
|
||||
this._options = _options;
|
||||
this._options = _options2;
|
||||
}
|
||||
/**
|
||||
* Get whether or not a log with the provided log level should be logged.
|
||||
@@ -29300,15 +29300,15 @@ function getPlatformSpecificData() {
|
||||
};
|
||||
const osInfo = {
|
||||
key: "OS",
|
||||
value: `(${os3.arch()}-${os3.type()}-${os3.release()})`
|
||||
value: `(${os4.arch()}-${os4.type()}-${os4.release()})`
|
||||
};
|
||||
return [runtimeInfo, osInfo];
|
||||
}
|
||||
var os3;
|
||||
var os4;
|
||||
var init_msRestUserAgentPolicy = __esm({
|
||||
"node_modules/.pnpm/@azure+core-http@3.0.3/node_modules/@azure/core-http/dist-esm/src/policies/msRestUserAgentPolicy.js"() {
|
||||
"use strict";
|
||||
os3 = __toESM(require("os"));
|
||||
os4 = __toESM(require("os"));
|
||||
init_constants();
|
||||
}
|
||||
});
|
||||
@@ -29352,10 +29352,10 @@ var init_userAgentPolicy = __esm({
|
||||
init_httpHeaders();
|
||||
getDefaultUserAgentHeaderName = getDefaultUserAgentKey;
|
||||
UserAgentPolicy = class extends BaseRequestPolicy {
|
||||
constructor(_nextPolicy, _options, headerKey, headerValue) {
|
||||
super(_nextPolicy, _options);
|
||||
constructor(_nextPolicy, _options2, headerKey, headerValue) {
|
||||
super(_nextPolicy, _options2);
|
||||
this._nextPolicy = _nextPolicy;
|
||||
this._options = _options;
|
||||
this._options = _options2;
|
||||
this.headerKey = headerKey;
|
||||
this.headerValue = headerValue;
|
||||
}
|
||||
@@ -30781,7 +30781,7 @@ var init_ProxyTracer = __esm({
|
||||
ProxyTracer2.prototype.startSpan = function(name, options2, context3) {
|
||||
return this._getTracer().startSpan(name, options2, context3);
|
||||
};
|
||||
ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
||||
ProxyTracer2.prototype.startActiveSpan = function(_name, _options2, _context, _fn) {
|
||||
var tracer = this._getTracer();
|
||||
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
||||
};
|
||||
@@ -30811,7 +30811,7 @@ var init_NoopTracerProvider = __esm({
|
||||
function() {
|
||||
function NoopTracerProvider2() {
|
||||
}
|
||||
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
|
||||
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options2) {
|
||||
return new NoopTracer();
|
||||
};
|
||||
return NoopTracerProvider2;
|
||||
@@ -46011,7 +46011,7 @@ var init_Credential = __esm({
|
||||
* @param _nextPolicy -
|
||||
* @param _options -
|
||||
*/
|
||||
create(_nextPolicy, _options) {
|
||||
create(_nextPolicy, _options2) {
|
||||
throw new Error("Method should be implemented in children classes.");
|
||||
}
|
||||
};
|
||||
@@ -46078,12 +46078,12 @@ var init_TelemetryPolicy = __esm({
|
||||
});
|
||||
|
||||
// node_modules/.pnpm/@azure+storage-blob@12.15.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/TelemetryPolicyFactory.js
|
||||
var os4, TelemetryPolicyFactory;
|
||||
var os5, TelemetryPolicyFactory;
|
||||
var init_TelemetryPolicyFactory = __esm({
|
||||
"node_modules/.pnpm/@azure+storage-blob@12.15.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/TelemetryPolicyFactory.js"() {
|
||||
"use strict";
|
||||
init_src6();
|
||||
os4 = __toESM(require("os"));
|
||||
os5 = __toESM(require("os"));
|
||||
init_TelemetryPolicy();
|
||||
init_constants2();
|
||||
TelemetryPolicyFactory = class {
|
||||
@@ -46105,8 +46105,8 @@ var init_TelemetryPolicyFactory = __esm({
|
||||
userAgentInfo.push(libInfo);
|
||||
}
|
||||
let runtimeInfo = `(NODE-VERSION ${process.version})`;
|
||||
if (os4) {
|
||||
runtimeInfo = `(NODE-VERSION ${process.version}; ${os4.type()} ${os4.release()})`;
|
||||
if (os5) {
|
||||
runtimeInfo = `(NODE-VERSION ${process.version}; ${os5.type()} ${os5.release()})`;
|
||||
}
|
||||
if (userAgentInfo.indexOf(runtimeInfo) === -1) {
|
||||
userAgentInfo.push(runtimeInfo);
|
||||
@@ -57377,15 +57377,18 @@ var require_cache = __commonJS({
|
||||
var import_promises2 = __toESM(require("fs/promises"));
|
||||
var import_os3 = __toESM(require("os"));
|
||||
var import_path3 = __toESM(require("path"));
|
||||
var import_process2 = require("process");
|
||||
var core4 = __toESM(require_core());
|
||||
var import_tool_cache = __toESM(require_tool_cache());
|
||||
|
||||
// src/options.ts
|
||||
var import_path = __toESM(require("path"));
|
||||
var import_os = __toESM(require("os"));
|
||||
var core2 = __toESM(require_core());
|
||||
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;
|
||||
@@ -58126,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) => {
|
||||
@@ -58163,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);
|
||||
@@ -58268,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, {
|
||||
@@ -58404,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,
|
||||
@@ -58501,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");
|
||||
}
|
||||
@@ -60950,10 +60968,178 @@ var nullableType = ZodNullable.create;
|
||||
var preprocessType = ZodEffects.createWithPreprocess;
|
||||
var pipelineType = ZodPipeline.create;
|
||||
|
||||
// node_modules/.pnpm/untildify@5.0.0/node_modules/untildify/index.js
|
||||
var import_node_os = __toESM(require("os"), 1);
|
||||
var homeDirectory = import_node_os.default.homedir();
|
||||
function untildify(pathWithTilde) {
|
||||
if (typeof pathWithTilde !== "string") {
|
||||
throw new TypeError(`Expected a string, got ${typeof pathWithTilde}`);
|
||||
}
|
||||
return homeDirectory ? pathWithTilde.replace(/^~(?=$|\/|\\)/, homeDirectory) : pathWithTilde;
|
||||
}
|
||||
|
||||
// src/options.ts
|
||||
var logLevelSchema = enumType(["q", "default", "v", "vv", "vvv"]);
|
||||
var PATHS = {
|
||||
pixiBin: import_path.default.join(import_os.default.homedir(), ".pixi", "bin", `pixi${import_os.default.platform() === "win32" ? ".exe" : ""}`)
|
||||
};
|
||||
var parseOrUndefined = (key, schema, errorMessage) => {
|
||||
const input = core.getInput(key);
|
||||
if (input === "") {
|
||||
return void 0;
|
||||
}
|
||||
const maybeResult = schema.safeParse(input);
|
||||
if (!maybeResult.success) {
|
||||
if (!errorMessage) {
|
||||
throw new Error(`${key} is not valid: ${maybeResult.error.message}`);
|
||||
}
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
return maybeResult.data;
|
||||
};
|
||||
var parseOrUndefinedJSON = (key, schema) => {
|
||||
const input = core.getInput(key);
|
||||
if (input === "") {
|
||||
return void 0;
|
||||
}
|
||||
return schema.parse(JSON.parse(input));
|
||||
};
|
||||
var validateInputs = (inputs) => {
|
||||
if (inputs.pixiVersion && inputs.pixiUrl) {
|
||||
throw new Error("You need to specify either pixi-version or pixi-url");
|
||||
}
|
||||
if (inputs.cacheKey !== void 0 && inputs.cache === false) {
|
||||
throw new Error("Cannot specify cache key without caching");
|
||||
}
|
||||
if (inputs.runInstall === false && inputs.cache === true) {
|
||||
throw new Error("Cannot cache without running install");
|
||||
}
|
||||
if (inputs.runInstall === false && inputs.frozen === true) {
|
||||
throw new Error("Cannot use `frozen: true` when not running install");
|
||||
}
|
||||
if (inputs.runInstall === false && inputs.locked === true) {
|
||||
throw new Error("Cannot use `locked: true` when not running install");
|
||||
}
|
||||
if (inputs.locked === true && inputs.frozen === true) {
|
||||
throw new Error("Cannot use `locked: true` and `frozen: true` at the same time");
|
||||
}
|
||||
if (inputs.authUsername && !inputs.authPassword || !inputs.authUsername && inputs.authPassword) {
|
||||
throw new Error("You need to specify both auth-username and auth-password");
|
||||
}
|
||||
if (inputs.authHost) {
|
||||
if (!inputs.authToken && !inputs.authUsername && !inputs.authCondaToken) {
|
||||
throw new Error("You need to specify either auth-token or auth-username and auth-password or auth-conda-token");
|
||||
}
|
||||
if (inputs.authToken && (inputs.authUsername || inputs.authCondaToken) || inputs.authUsername && inputs.authCondaToken) {
|
||||
throw new Error("You cannot specify two auth methods");
|
||||
}
|
||||
}
|
||||
if (!inputs.authHost) {
|
||||
if (inputs.authToken || inputs.authUsername || inputs.authCondaToken) {
|
||||
throw new Error("You need to specify auth-host");
|
||||
}
|
||||
}
|
||||
if (inputs.cacheWrite && !inputs.cacheKey && !inputs.cache) {
|
||||
throw new Error("cache-write is only valid with cache-key or cache specified.");
|
||||
}
|
||||
};
|
||||
var inferOptions = (inputs) => {
|
||||
const runInstall = inputs.runInstall ?? true;
|
||||
const pixiSource = inputs.pixiVersion ? { version: inputs.pixiVersion } : inputs.pixiUrl ? { url: inputs.pixiUrl } : { version: "latest" };
|
||||
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 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,
|
||||
token: inputs.authToken
|
||||
} : inputs.authCondaToken ? {
|
||||
host: inputs.authHost,
|
||||
condaToken: inputs.authCondaToken
|
||||
} : {
|
||||
host: inputs.authHost,
|
||||
username: inputs.authUsername,
|
||||
password: inputs.authPassword
|
||||
};
|
||||
const postCleanup = inputs.postCleanup ?? true;
|
||||
return {
|
||||
pixiSource,
|
||||
logLevel,
|
||||
manifestPath,
|
||||
pixiLockFile,
|
||||
runInstall,
|
||||
frozen,
|
||||
locked,
|
||||
cache: cache2,
|
||||
pixiBinPath,
|
||||
auth,
|
||||
postCleanup
|
||||
};
|
||||
};
|
||||
var assertOptions = (_options2) => {
|
||||
};
|
||||
var getOptions = () => {
|
||||
const inputs = {
|
||||
pixiVersion: parseOrUndefined(
|
||||
"pixi-version",
|
||||
unionType([literalType("latest"), stringType().regex(/^v\d+\.\d+\.\d+$/)]),
|
||||
"pixi-version must either be `latest` or a version string matching `vX.Y.Z`."
|
||||
),
|
||||
pixiUrl: parseOrUndefined("pixi-url", stringType().url()),
|
||||
logLevel: parseOrUndefined(
|
||||
"log-level",
|
||||
logLevelSchema,
|
||||
"log-level must be one of `q`, `default`, `v`, `vv`, `vvv`."
|
||||
),
|
||||
manifestPath: parseOrUndefined("manifest-path", stringType()),
|
||||
runInstall: parseOrUndefinedJSON("run-install", booleanType()),
|
||||
locked: parseOrUndefinedJSON("locked", booleanType()),
|
||||
frozen: parseOrUndefinedJSON("frozen", booleanType()),
|
||||
cache: parseOrUndefinedJSON("cache", booleanType()),
|
||||
cacheKey: parseOrUndefined("cache-key", stringType()),
|
||||
cacheWrite: parseOrUndefinedJSON("cache-write", booleanType()),
|
||||
pixiBinPath: parseOrUndefined("pixi-bin-path", stringType()),
|
||||
authHost: parseOrUndefined("auth-host", stringType()),
|
||||
authToken: parseOrUndefined("auth-token", stringType()),
|
||||
authUsername: parseOrUndefined("auth-username", stringType()),
|
||||
authPassword: parseOrUndefined("auth-password", stringType()),
|
||||
authCondaToken: parseOrUndefined("auth-conda-token", stringType()),
|
||||
postCleanup: parseOrUndefinedJSON("post-cleanup", booleanType())
|
||||
};
|
||||
core.debug(`Inputs: ${JSON.stringify(inputs)}`);
|
||||
validateInputs(inputs);
|
||||
const options2 = inferOptions(inputs);
|
||||
core.debug(`Inferred options: ${JSON.stringify(options2)}`);
|
||||
assertOptions(options2);
|
||||
return options2;
|
||||
};
|
||||
var _options;
|
||||
try {
|
||||
_options = getOptions();
|
||||
} catch (error2) {
|
||||
if (core.isDebug()) {
|
||||
throw error2;
|
||||
}
|
||||
if (error2 instanceof Error) {
|
||||
core.setFailed(error2.message);
|
||||
(0, import_process.exit)(1);
|
||||
} else if (typeof error2 === "string") {
|
||||
core.setFailed(error2);
|
||||
(0, import_process.exit)(1);
|
||||
}
|
||||
throw error2;
|
||||
}
|
||||
var options = _options;
|
||||
|
||||
// src/util.ts
|
||||
var import_crypto4 = require("crypto");
|
||||
var os = __toESM(require("os"));
|
||||
var core = __toESM(require_core());
|
||||
var os3 = __toESM(require("os"));
|
||||
var core2 = __toESM(require_core());
|
||||
var import_exec = __toESM(require_exec());
|
||||
var getCondaArch = () => {
|
||||
const archDict = {
|
||||
@@ -60964,14 +61150,14 @@ var getCondaArch = () => {
|
||||
"linux-ppc64": "linux-ppc64le",
|
||||
"win32-x64": "win-64"
|
||||
};
|
||||
const arch3 = archDict[`${os.platform()}-${os.arch()}`];
|
||||
const arch3 = archDict[`${os3.platform()}-${os3.arch()}`];
|
||||
if (!arch3) {
|
||||
throw new Error(`Unsupported platform: ${os.platform()}-${os.arch()}`);
|
||||
throw new Error(`Unsupported platform: ${os3.platform()}-${os3.arch()}`);
|
||||
}
|
||||
return arch3;
|
||||
};
|
||||
var getPlatform = () => {
|
||||
const platform2 = os.platform();
|
||||
const platform2 = os3.platform();
|
||||
switch (platform2) {
|
||||
case "darwin":
|
||||
return "apple-darwin";
|
||||
@@ -60984,7 +61170,7 @@ var getPlatform = () => {
|
||||
}
|
||||
};
|
||||
var getArch = () => {
|
||||
const arch3 = os.arch();
|
||||
const arch3 = os3.arch();
|
||||
switch (arch3) {
|
||||
case "x64":
|
||||
return "x86_64";
|
||||
@@ -61010,7 +61196,7 @@ var sha256 = (s) => {
|
||||
return (0, import_crypto4.createHash)("sha256").update(s).digest("hex");
|
||||
};
|
||||
var execute = (cmd) => {
|
||||
core.debug(`Executing: ${cmd.join(" ")}`);
|
||||
core2.debug(`Executing: ${cmd.join(" ")}`);
|
||||
return (0, import_exec.exec)(cmd[0], cmd.slice(1));
|
||||
};
|
||||
var pixiCmd = (command, withManifestPath = true) => {
|
||||
@@ -61019,156 +61205,54 @@ var pixiCmd = (command, withManifestPath = true) => {
|
||||
commandArray = commandArray.concat(["--manifest-path", options.manifestPath]);
|
||||
}
|
||||
switch (options.logLevel) {
|
||||
case "trace":
|
||||
case "vvv":
|
||||
commandArray = commandArray.concat(["-vvv"]);
|
||||
break;
|
||||
case "debug":
|
||||
case "vv":
|
||||
commandArray = commandArray.concat(["-vv"]);
|
||||
break;
|
||||
case "info":
|
||||
case "v":
|
||||
commandArray = commandArray.concat(["-v"]);
|
||||
break;
|
||||
case "warn":
|
||||
case "default":
|
||||
break;
|
||||
case "quiet":
|
||||
case "q":
|
||||
commandArray = commandArray.concat(["-q"]);
|
||||
break;
|
||||
}
|
||||
return commandArray;
|
||||
};
|
||||
|
||||
// src/options.ts
|
||||
var logLevelSchema = enumType(["quiet", "warn", "info", "debug", "trace"]);
|
||||
var postCleanupSchema = enumType(["none", "environment", "all"]);
|
||||
var PATHS = {
|
||||
pixiBin: import_path.default.join(import_os.default.homedir(), ".pixi", "bin", `pixi${import_os.default.platform() === "win32" ? ".exe" : ""}`),
|
||||
pixiRunShellScript: import_path.default.join(import_os.default.homedir(), ".pixi", "bin", "pixi-shell"),
|
||||
bashProfile: import_path.default.join(import_os.default.homedir(), ".bash_profile"),
|
||||
bashrc: import_path.default.join(import_os.default.homedir(), ".bashrc")
|
||||
};
|
||||
var parseOrUndefined = (key, schema) => {
|
||||
const input = core2.getInput(key);
|
||||
if (input === "") {
|
||||
return void 0;
|
||||
}
|
||||
return schema.parse(input);
|
||||
};
|
||||
var parseOrUndefinedJSON = (key, schema) => {
|
||||
const input = core2.getInput(key);
|
||||
if (input === "") {
|
||||
return void 0;
|
||||
}
|
||||
return schema.parse(JSON.parse(input));
|
||||
};
|
||||
var validateInputs = (inputs) => {
|
||||
if (inputs.pixiVersion && inputs.pixiUrl) {
|
||||
throw new Error("You need to specify either pixi-version or pixi-url");
|
||||
}
|
||||
if (inputs.cacheKey !== void 0 && inputs.cache === false) {
|
||||
throw new Error("Cannot specify cache key without caching");
|
||||
}
|
||||
if (inputs.runInstall === false && inputs.cache === true) {
|
||||
throw new Error("Cannot cache without running install");
|
||||
}
|
||||
if (inputs.authUsername && !inputs.authPassword || !inputs.authUsername && inputs.authPassword) {
|
||||
throw new Error("You need to specify both auth-username and auth-password");
|
||||
}
|
||||
if (inputs.authHost) {
|
||||
if (!inputs.authToken && !inputs.authUsername && !inputs.authCondaToken) {
|
||||
throw new Error("You need to specify either auth-token or auth-username and auth-password or auth-conda-token");
|
||||
}
|
||||
if (inputs.authToken && (inputs.authUsername || inputs.authCondaToken) || inputs.authUsername && inputs.authCondaToken) {
|
||||
throw new Error("You cannot specify two auth methods");
|
||||
}
|
||||
}
|
||||
if (!inputs.authHost) {
|
||||
if (inputs.authToken || inputs.authUsername || inputs.authCondaToken) {
|
||||
throw new Error("You need to specify auth-host");
|
||||
}
|
||||
}
|
||||
};
|
||||
var inferOptions = (inputs) => {
|
||||
const runInstall = inputs.runInstall ?? true;
|
||||
const pixiSource = inputs.pixiVersion ? { version: inputs.pixiVersion } : inputs.pixiUrl ? { url: inputs.pixiUrl } : { version: "latest" };
|
||||
const logLevel = inputs.logLevel ?? (core2.isDebug() ? "debug" : "warn");
|
||||
const manifestPath = inputs.manifestPath ?? "pixi.toml";
|
||||
const pixiLockFile = import_path.default.basename(manifestPath).replace(/\.toml$/, ".lock");
|
||||
const generateRunShell = inputs.generateRunShell ?? runInstall;
|
||||
const cacheKey = inputs.cacheKey ?? (inputs.cache ? `pixi-${getCondaArch()}` : void 0);
|
||||
const pixiBinPath = inputs.pixiBinPath ?? PATHS.pixiBin;
|
||||
const auth = inputs.authHost ? {
|
||||
host: inputs.authHost,
|
||||
token: inputs.authToken,
|
||||
username: inputs.authUsername,
|
||||
password: inputs.authPassword,
|
||||
condaToken: inputs.authCondaToken
|
||||
} : void 0;
|
||||
const postCleanup = inputs.postCleanup ?? "all";
|
||||
return {
|
||||
pixiSource,
|
||||
logLevel,
|
||||
manifestPath,
|
||||
pixiLockFile,
|
||||
runInstall,
|
||||
generateRunShell,
|
||||
cacheKey,
|
||||
pixiBinPath,
|
||||
auth,
|
||||
postCleanup
|
||||
};
|
||||
};
|
||||
var assertOptions = (_options) => {
|
||||
};
|
||||
var getOptions = () => {
|
||||
const inputs = {
|
||||
pixiVersion: parseOrUndefined("pixi-version", unionType([literalType("latest"), stringType().regex(/^v\d+\.\d+\.\d+$/)])),
|
||||
pixiUrl: parseOrUndefined("pixi-url", stringType().url()),
|
||||
logLevel: parseOrUndefined("log-level", logLevelSchema),
|
||||
manifestPath: parseOrUndefined("manifest-path", stringType()),
|
||||
runInstall: parseOrUndefinedJSON("run-install", booleanType()),
|
||||
generateRunShell: parseOrUndefinedJSON("generate-run-shell", booleanType()),
|
||||
cache: parseOrUndefinedJSON("cache", booleanType()),
|
||||
cacheKey: parseOrUndefined("cache-key", stringType()),
|
||||
pixiBinPath: parseOrUndefined("micromamba-binary-path", stringType()),
|
||||
authHost: parseOrUndefined("auth-host", stringType()),
|
||||
authToken: parseOrUndefined("auth-token", stringType()),
|
||||
authUsername: parseOrUndefined("auth-username", stringType()),
|
||||
authPassword: parseOrUndefined("auth-password", stringType()),
|
||||
authCondaToken: parseOrUndefined("auth-conda-token", stringType()),
|
||||
postCleanup: parseOrUndefined("post-cleanup", postCleanupSchema)
|
||||
};
|
||||
core2.debug(`Inputs: ${JSON.stringify(inputs)}`);
|
||||
validateInputs(inputs);
|
||||
const options2 = inferOptions(inputs);
|
||||
core2.debug(`Inferred options: ${JSON.stringify(options2)}`);
|
||||
assertOptions(options2);
|
||||
return options2;
|
||||
};
|
||||
var options = getOptions();
|
||||
|
||||
// src/cache.ts
|
||||
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}${sha256(content)}`).catch((err) => {
|
||||
var generateCacheKey = async (cacheKeyPrefix) => import_promises.default.readFile(options.pixiLockFile, "utf-8").then((content) => {
|
||||
const contentsSha = sha256(content);
|
||||
const lockFileSha = sha256(options.pixiLockFile);
|
||||
const sha = sha256(contentsSha + lockFileSha);
|
||||
return `${cacheKeyPrefix}${getCondaArch()}-${sha}`;
|
||||
}).catch((err) => {
|
||||
throw new Error(`Failed to generate cache key: ${err}`);
|
||||
});
|
||||
var cachePath = import_path2.default.join(import_path2.default.basename(options.manifestPath), ".pixi");
|
||||
var cachePath = import_path2.default.join(import_path2.default.dirname(options.pixiLockFile), ".pixi");
|
||||
var cacheHit = false;
|
||||
var tryRestoreCache = () => {
|
||||
const cacheKeyPrefix = options.cacheKey;
|
||||
if (!cacheKeyPrefix) {
|
||||
const cache_ = options.cache;
|
||||
if (!cache_) {
|
||||
core3.debug("Skipping pixi cache restore.");
|
||||
return Promise.resolve(void 0);
|
||||
}
|
||||
return core3.group(
|
||||
"Restoring pixi cache",
|
||||
() => generateCacheKey(cacheKeyPrefix).then((cacheKey) => {
|
||||
() => generateCacheKey(cache_.cacheKeyPrefix).then((cacheKey) => {
|
||||
core3.debug(`Cache key: ${cacheKey}`);
|
||||
core3.debug(`Cache path: ${cachePath}`);
|
||||
return cache.restoreCache([cachePath], cacheKey, void 0, void 0, false).then((key) => {
|
||||
if (key) {
|
||||
core3.info(`Restored cache with key \`${key}\``);
|
||||
cacheHit = true;
|
||||
} else {
|
||||
core3.info(`Cache miss`);
|
||||
}
|
||||
@@ -61178,14 +61262,18 @@ var tryRestoreCache = () => {
|
||||
);
|
||||
};
|
||||
var saveCache2 = () => {
|
||||
const cacheKeyPrefix = options.cacheKey;
|
||||
if (!cacheKeyPrefix) {
|
||||
const cache_ = options.cache;
|
||||
if (!cache_ || !cache_.cacheWrite) {
|
||||
core3.debug("Skipping pixi cache save.");
|
||||
return Promise.resolve(void 0);
|
||||
}
|
||||
if (cacheHit) {
|
||||
core3.debug("Skipping pixi cache save because cache was restored.");
|
||||
return Promise.resolve(void 0);
|
||||
}
|
||||
return core3.group(
|
||||
"Saving pixi cache",
|
||||
() => generateCacheKey(cacheKeyPrefix).then(
|
||||
() => generateCacheKey(cache_.cacheKeyPrefix).then(
|
||||
(cacheKey) => cache.saveCache([cachePath], cacheKey, void 0, false).then((cacheId) => {
|
||||
core3.info(`Saved cache with ID \`${cacheId}\``);
|
||||
}).catch((err) => {
|
||||
@@ -61210,6 +61298,7 @@ var pixiLogin = () => {
|
||||
core4.debug("Skipping pixi login.");
|
||||
return Promise.resolve(0);
|
||||
}
|
||||
core4.debug(`auth keys: ${Object.keys(auth)}`);
|
||||
return core4.group("Logging in to private channel", () => {
|
||||
if ("token" in auth) {
|
||||
core4.debug(`Logging in to ${auth.host} with token`);
|
||||
@@ -61231,42 +61320,33 @@ var pixiInstall = async () => {
|
||||
core4.debug("Skipping pixi install.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
return tryRestoreCache().then((_cacheKey) => execute(pixiCmd("install"))).then(saveCache2);
|
||||
};
|
||||
var generatePixiRunShell = () => {
|
||||
if (!options.generateRunShell) {
|
||||
core4.debug("Skipping pixi run shell generation.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (import_os3.default.platform() === "win32") {
|
||||
core4.info("Skipping pixi run shell on Windows.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
core4.info("Generating pixi run shell.");
|
||||
const pixiRunShellContents = `#!/usr/bin/env sh
|
||||
chmod +x $1
|
||||
pixi run $1
|
||||
`;
|
||||
return core4.group("Generating pixi run shell", () => {
|
||||
core4.debug(`Writing pixi run shell to ${PATHS.pixiRunShellScript}`);
|
||||
core4.debug(`File contents:
|
||||
"${pixiRunShellContents}"`);
|
||||
return import_promises2.default.writeFile(PATHS.pixiRunShellScript, pixiRunShellContents, { encoding: "utf8", mode: 493 });
|
||||
});
|
||||
return tryRestoreCache().then(
|
||||
(_cacheKey) => execute(pixiCmd(`install${options.frozen ? " --frozen" : ""}${options.locked ? " --locked" : ""}`))
|
||||
).then(saveCache2);
|
||||
};
|
||||
var generateInfo = () => core4.group("pixi info", () => execute(pixiCmd("info")));
|
||||
var run = async () => {
|
||||
core4.debug(`process.env.HOME: ${process.env.HOME}`);
|
||||
core4.debug(`os.homedir(): ${import_os3.default.homedir()}`);
|
||||
core4.debug(`bashProfile ${PATHS.bashProfile}`);
|
||||
await downloadPixi(options.pixiSource);
|
||||
addPixiToPath();
|
||||
await pixiLogin();
|
||||
await pixiInstall();
|
||||
await generatePixiRunShell();
|
||||
await generateInfo();
|
||||
};
|
||||
run().catch((error2) => core4.setFailed(error2.message));
|
||||
run().catch((error2) => {
|
||||
if (core4.isDebug()) {
|
||||
throw error2;
|
||||
}
|
||||
if (error2 instanceof Error) {
|
||||
core4.setFailed(error2.message);
|
||||
(0, import_process2.exit)(1);
|
||||
} else if (typeof error2 === "string") {
|
||||
core4.setFailed(error2);
|
||||
(0, import_process2.exit)(1);
|
||||
}
|
||||
throw error2;
|
||||
});
|
||||
/*! Bundled license information:
|
||||
|
||||
mime-db/index.js:
|
||||
|
||||
+6072
-1
File diff suppressed because it is too large
Load Diff
+13
-12
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"name": "setup-pixi",
|
||||
"version": "0.1.1",
|
||||
"version": "0.4.1",
|
||||
"private": true,
|
||||
"description": "Action to set up the pixi package manager.",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"dev": "tsup --watch",
|
||||
"lint": "eslint ./src --ext ts"
|
||||
"lint": "eslint ./src --ext ts",
|
||||
"lint:fix": "eslint ./src --ext ts --fix"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,25 +22,25 @@
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.2.2",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@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.5.9",
|
||||
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||
"@typescript-eslint/parser": "^6.5.0",
|
||||
"eslint": "^8.48.0",
|
||||
"@types/node": "^20.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-n": "^16.0.2",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-n": "^16.3.1",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
|
||||
Generated
+389
-324
File diff suppressed because it is too large
Load Diff
+23
-9
@@ -3,31 +3,41 @@ import path from 'path'
|
||||
import * as core from '@actions/core'
|
||||
import * as cache from '@actions/cache'
|
||||
import { options } from './options'
|
||||
import { sha256 } from './util'
|
||||
import { getCondaArch, sha256 } from './util'
|
||||
|
||||
export const generateCacheKey = async (cacheKeyPrefix: string) =>
|
||||
fs
|
||||
.readFile(options.pixiLockFile, 'utf-8')
|
||||
.then((content) => `${cacheKeyPrefix}${sha256(content)}`)
|
||||
.then((content) => {
|
||||
const contentsSha = sha256(content)
|
||||
// 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 lockFileSha = sha256(options.pixiLockFile)
|
||||
const sha = sha256(contentsSha + lockFileSha)
|
||||
return `${cacheKeyPrefix}${getCondaArch()}-${sha}`
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new Error(`Failed to generate cache key: ${err}`)
|
||||
})
|
||||
|
||||
const cachePath = path.join(path.basename(options.manifestPath), '.pixi')
|
||||
const cachePath = path.join(path.dirname(options.pixiLockFile), '.pixi')
|
||||
|
||||
let cacheHit = false
|
||||
|
||||
export const tryRestoreCache = (): Promise<string | undefined> => {
|
||||
const cacheKeyPrefix = options.cacheKey
|
||||
if (!cacheKeyPrefix) {
|
||||
const cache_ = options.cache
|
||||
if (!cache_) {
|
||||
core.debug('Skipping pixi cache restore.')
|
||||
return Promise.resolve(undefined)
|
||||
}
|
||||
return core.group('Restoring pixi cache', () =>
|
||||
generateCacheKey(cacheKeyPrefix).then((cacheKey) => {
|
||||
generateCacheKey(cache_.cacheKeyPrefix).then((cacheKey) => {
|
||||
core.debug(`Cache key: ${cacheKey}`)
|
||||
core.debug(`Cache path: ${cachePath}`)
|
||||
return cache.restoreCache([cachePath], cacheKey, undefined, undefined, false).then((key) => {
|
||||
if (key) {
|
||||
core.info(`Restored cache with key \`${key}\``)
|
||||
cacheHit = true
|
||||
} else {
|
||||
core.info(`Cache miss`)
|
||||
}
|
||||
@@ -38,13 +48,17 @@ export const tryRestoreCache = (): Promise<string | undefined> => {
|
||||
}
|
||||
|
||||
export const saveCache = () => {
|
||||
const cacheKeyPrefix = options.cacheKey
|
||||
if (!cacheKeyPrefix) {
|
||||
const cache_ = options.cache
|
||||
if (!cache_ || !cache_.cacheWrite) {
|
||||
core.debug('Skipping pixi cache save.')
|
||||
return Promise.resolve(undefined)
|
||||
}
|
||||
if (cacheHit) {
|
||||
core.debug('Skipping pixi cache save because cache was restored.')
|
||||
return Promise.resolve(undefined)
|
||||
}
|
||||
return core.group('Saving pixi cache', () =>
|
||||
generateCacheKey(cacheKeyPrefix).then((cacheKey) =>
|
||||
generateCacheKey(cache_.cacheKeyPrefix).then((cacheKey) =>
|
||||
cache
|
||||
.saveCache([cachePath], cacheKey, undefined, false)
|
||||
.then((cacheId) => {
|
||||
|
||||
+19
-26
@@ -1,10 +1,11 @@
|
||||
import fs from 'fs/promises'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import { exit } from 'process'
|
||||
import * as core from '@actions/core'
|
||||
import { downloadTool } from '@actions/tool-cache'
|
||||
import type { PixiSource } from './options'
|
||||
import { PATHS, options } from './options'
|
||||
import { options } from './options'
|
||||
import { execute, getPixiUrlFromVersion, pixiCmd } from './util'
|
||||
import { saveCache, tryRestoreCache } from './cache'
|
||||
|
||||
@@ -27,6 +28,7 @@ const pixiLogin = () => {
|
||||
core.debug('Skipping pixi login.')
|
||||
return Promise.resolve(0)
|
||||
}
|
||||
core.debug(`auth keys: ${Object.keys(auth)}`)
|
||||
return core.group('Logging in to private channel', () => {
|
||||
// tokens get censored in the logs as long as they are a github secret
|
||||
if ('token' in auth) {
|
||||
@@ -52,43 +54,34 @@ const pixiInstall = async () => {
|
||||
return Promise.resolve()
|
||||
}
|
||||
return tryRestoreCache()
|
||||
.then((_cacheKey) => execute(pixiCmd('install')))
|
||||
.then((_cacheKey) =>
|
||||
execute(pixiCmd(`install${options.frozen ? ' --frozen' : ''}${options.locked ? ' --locked' : ''}`))
|
||||
)
|
||||
.then(saveCache)
|
||||
}
|
||||
|
||||
const generatePixiRunShell = () => {
|
||||
if (!options.generateRunShell) {
|
||||
core.debug('Skipping pixi run shell generation.')
|
||||
return Promise.resolve()
|
||||
}
|
||||
if (os.platform() === 'win32') {
|
||||
core.info('Skipping pixi run shell on Windows.')
|
||||
return Promise.resolve()
|
||||
}
|
||||
core.info('Generating pixi run shell.')
|
||||
const pixiRunShellContents = `#!/usr/bin/env sh
|
||||
chmod +x $1
|
||||
pixi run $1
|
||||
`
|
||||
return core.group('Generating pixi run shell', () => {
|
||||
core.debug(`Writing pixi run shell to ${PATHS.pixiRunShellScript}`)
|
||||
core.debug(`File contents:\n"${pixiRunShellContents}"`)
|
||||
return fs.writeFile(PATHS.pixiRunShellScript, pixiRunShellContents, { encoding: 'utf8', mode: 0o755 })
|
||||
})
|
||||
}
|
||||
|
||||
const generateInfo = () => core.group('pixi info', () => execute(pixiCmd('info')))
|
||||
|
||||
const run = async () => {
|
||||
core.debug(`process.env.HOME: ${process.env.HOME}`)
|
||||
core.debug(`os.homedir(): ${os.homedir()}`)
|
||||
core.debug(`bashProfile ${PATHS.bashProfile}`)
|
||||
await downloadPixi(options.pixiSource)
|
||||
addPixiToPath()
|
||||
await pixiLogin()
|
||||
await pixiInstall()
|
||||
await generatePixiRunShell()
|
||||
await generateInfo()
|
||||
}
|
||||
|
||||
run().catch((error) => core.setFailed(error.message))
|
||||
run().catch((error) => {
|
||||
if (core.isDebug()) {
|
||||
throw error
|
||||
}
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(error.message)
|
||||
exit(1)
|
||||
} else if (typeof error === 'string') {
|
||||
core.setFailed(error)
|
||||
exit(1)
|
||||
}
|
||||
throw error
|
||||
})
|
||||
|
||||
+108
-42
@@ -1,8 +1,10 @@
|
||||
import path from 'path'
|
||||
import os from 'os'
|
||||
import { exit } from 'process'
|
||||
import { existsSync } from 'fs'
|
||||
import * as core from '@actions/core'
|
||||
import * as z from 'zod'
|
||||
import { getCondaArch } from './util'
|
||||
import untildify from 'untildify'
|
||||
|
||||
type Inputs = {
|
||||
pixiVersion?: string
|
||||
@@ -10,16 +12,18 @@ type Inputs = {
|
||||
logLevel?: LogLevel
|
||||
manifestPath?: string
|
||||
runInstall?: boolean
|
||||
generateRunShell?: boolean
|
||||
frozen?: boolean
|
||||
locked?: boolean
|
||||
cache?: boolean
|
||||
cacheKey?: string
|
||||
cacheWrite?: boolean
|
||||
pixiBinPath?: string
|
||||
authHost?: string
|
||||
authToken?: string
|
||||
authUsername?: string
|
||||
authPassword?: string
|
||||
authCondaToken?: string
|
||||
postCleanup?: PostCleanup
|
||||
postCleanup?: boolean
|
||||
}
|
||||
|
||||
export type PixiSource =
|
||||
@@ -45,39 +49,46 @@ type Auth = {
|
||||
}
|
||||
)
|
||||
|
||||
type Cache = {
|
||||
cacheKeyPrefix: string
|
||||
cacheWrite: boolean
|
||||
}
|
||||
|
||||
export type Options = Readonly<{
|
||||
pixiSource: PixiSource
|
||||
logLevel: LogLevel
|
||||
manifestPath: string
|
||||
pixiLockFile: string
|
||||
runInstall: boolean
|
||||
generateRunShell: boolean
|
||||
cacheKey?: string // undefined if cache is false
|
||||
frozen: boolean
|
||||
locked: boolean
|
||||
cache?: Cache
|
||||
pixiBinPath: string
|
||||
auth?: Auth
|
||||
postCleanup: PostCleanup
|
||||
postCleanup: boolean
|
||||
}>
|
||||
|
||||
const logLevelSchema = z.enum(['quiet', 'warn', 'info', 'debug', 'trace'])
|
||||
const logLevelSchema = z.enum(['q', 'default', 'v', 'vv', 'vvv'])
|
||||
export type LogLevel = z.infer<typeof logLevelSchema>
|
||||
|
||||
const postCleanupSchema = z.enum(['none', 'environment', 'all'])
|
||||
export type PostCleanup = z.infer<typeof postCleanupSchema>
|
||||
|
||||
export const PATHS = {
|
||||
pixiBin: path.join(os.homedir(), '.pixi', 'bin', `pixi${os.platform() === 'win32' ? '.exe' : ''}`),
|
||||
pixiRunShellScript: path.join(os.homedir(), '.pixi', 'bin', 'pixi-shell'),
|
||||
bashProfile: path.join(os.homedir(), '.bash_profile'),
|
||||
bashrc: path.join(os.homedir(), '.bashrc')
|
||||
pixiBin: path.join(os.homedir(), '.pixi', 'bin', `pixi${os.platform() === 'win32' ? '.exe' : ''}`)
|
||||
}
|
||||
|
||||
const parseOrUndefined = <T>(key: string, schema: z.ZodSchema<T>): T | undefined => {
|
||||
const parseOrUndefined = <T>(key: string, schema: z.ZodSchema<T>, errorMessage?: string): T | undefined => {
|
||||
const input = core.getInput(key)
|
||||
// GitHub actions sets empty inputs to the empty string, but we want undefined
|
||||
if (input === '') {
|
||||
return undefined
|
||||
}
|
||||
return schema.parse(input)
|
||||
const maybeResult = schema.safeParse(input)
|
||||
if (!maybeResult.success) {
|
||||
if (!errorMessage) {
|
||||
throw new Error(`${key} is not valid: ${maybeResult.error.message}`)
|
||||
}
|
||||
throw new Error(errorMessage)
|
||||
}
|
||||
return maybeResult.data
|
||||
}
|
||||
|
||||
const parseOrUndefinedJSON = <T>(key: string, schema: z.ZodSchema<T>): T | undefined => {
|
||||
@@ -99,6 +110,15 @@ const validateInputs = (inputs: Inputs): void => {
|
||||
if (inputs.runInstall === false && inputs.cache === true) {
|
||||
throw new Error('Cannot cache without running install')
|
||||
}
|
||||
if (inputs.runInstall === false && inputs.frozen === true) {
|
||||
throw new Error('Cannot use `frozen: true` when not running install')
|
||||
}
|
||||
if (inputs.runInstall === false && inputs.locked === true) {
|
||||
throw new Error('Cannot use `locked: true` when not running install')
|
||||
}
|
||||
if (inputs.locked === true && inputs.frozen === true) {
|
||||
throw new Error('Cannot use `locked: true` and `frozen: true` at the same time')
|
||||
}
|
||||
if ((inputs.authUsername && !inputs.authPassword) || (!inputs.authUsername && inputs.authPassword)) {
|
||||
throw new Error('You need to specify both auth-username and auth-password')
|
||||
}
|
||||
@@ -119,6 +139,9 @@ const validateInputs = (inputs: Inputs): void => {
|
||||
throw new Error('You need to specify auth-host')
|
||||
}
|
||||
}
|
||||
if (inputs.cacheWrite && !inputs.cacheKey && !inputs.cache) {
|
||||
throw new Error('cache-write is only valid with cache-key or cache specified.')
|
||||
}
|
||||
}
|
||||
|
||||
const inferOptions = (inputs: Inputs): Options => {
|
||||
@@ -126,32 +149,48 @@ const inferOptions = (inputs: Inputs): Options => {
|
||||
const pixiSource = inputs.pixiVersion
|
||||
? { version: inputs.pixiVersion }
|
||||
: inputs.pixiUrl
|
||||
? { url: inputs.pixiUrl }
|
||||
: { version: 'latest' }
|
||||
const logLevel = inputs.logLevel ?? (core.isDebug() ? 'debug' : 'warn')
|
||||
const manifestPath = inputs.manifestPath ?? 'pixi.toml'
|
||||
const pixiLockFile = path.basename(manifestPath).replace(/\.toml$/, '.lock')
|
||||
const generateRunShell = inputs.generateRunShell ?? runInstall
|
||||
const cacheKey = inputs.cacheKey ?? (inputs.cache ? `pixi-${getCondaArch()}` : undefined)
|
||||
const pixiBinPath = inputs.pixiBinPath ?? PATHS.pixiBin
|
||||
const auth = inputs.authHost
|
||||
? ({
|
||||
host: inputs.authHost,
|
||||
token: inputs.authToken,
|
||||
username: inputs.authUsername,
|
||||
password: inputs.authPassword,
|
||||
condaToken: inputs.authCondaToken
|
||||
} as Auth)
|
||||
: undefined
|
||||
const postCleanup = inputs.postCleanup ?? 'all'
|
||||
? { 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 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
|
||||
: ((inputs.authToken
|
||||
? {
|
||||
host: inputs.authHost,
|
||||
token: inputs.authToken
|
||||
}
|
||||
: inputs.authCondaToken
|
||||
? {
|
||||
host: inputs.authHost,
|
||||
condaToken: inputs.authCondaToken
|
||||
}
|
||||
: {
|
||||
host: inputs.authHost,
|
||||
username: inputs.authUsername!,
|
||||
password: inputs.authPassword!
|
||||
}) as Auth)
|
||||
const postCleanup = inputs.postCleanup ?? true
|
||||
return {
|
||||
pixiSource,
|
||||
logLevel,
|
||||
manifestPath,
|
||||
pixiLockFile,
|
||||
runInstall,
|
||||
generateRunShell,
|
||||
cacheKey,
|
||||
frozen,
|
||||
locked,
|
||||
cache,
|
||||
pixiBinPath,
|
||||
auth,
|
||||
postCleanup
|
||||
@@ -169,21 +208,31 @@ const assertOptions = (_options: Options) => {
|
||||
|
||||
const getOptions = () => {
|
||||
const inputs: Inputs = {
|
||||
pixiVersion: parseOrUndefined('pixi-version', z.union([z.literal('latest'), z.string().regex(/^v\d+\.\d+\.\d+$/)])),
|
||||
pixiVersion: parseOrUndefined(
|
||||
'pixi-version',
|
||||
z.union([z.literal('latest'), z.string().regex(/^v\d+\.\d+\.\d+$/)]),
|
||||
'pixi-version must either be `latest` or a version string matching `vX.Y.Z`.'
|
||||
),
|
||||
pixiUrl: parseOrUndefined('pixi-url', z.string().url()),
|
||||
logLevel: parseOrUndefined('log-level', logLevelSchema),
|
||||
logLevel: parseOrUndefined(
|
||||
'log-level',
|
||||
logLevelSchema,
|
||||
'log-level must be one of `q`, `default`, `v`, `vv`, `vvv`.'
|
||||
),
|
||||
manifestPath: parseOrUndefined('manifest-path', z.string()),
|
||||
runInstall: parseOrUndefinedJSON('run-install', z.boolean()),
|
||||
generateRunShell: parseOrUndefinedJSON('generate-run-shell', z.boolean()),
|
||||
locked: parseOrUndefinedJSON('locked', z.boolean()),
|
||||
frozen: parseOrUndefinedJSON('frozen', z.boolean()),
|
||||
cache: parseOrUndefinedJSON('cache', z.boolean()),
|
||||
cacheKey: parseOrUndefined('cache-key', z.string()),
|
||||
pixiBinPath: parseOrUndefined('micromamba-binary-path', z.string()),
|
||||
cacheWrite: parseOrUndefinedJSON('cache-write', z.boolean()),
|
||||
pixiBinPath: parseOrUndefined('pixi-bin-path', z.string()),
|
||||
authHost: parseOrUndefined('auth-host', z.string()),
|
||||
authToken: parseOrUndefined('auth-token', z.string()),
|
||||
authUsername: parseOrUndefined('auth-username', z.string()),
|
||||
authPassword: parseOrUndefined('auth-password', z.string()),
|
||||
authCondaToken: parseOrUndefined('auth-conda-token', z.string()),
|
||||
postCleanup: parseOrUndefined('post-cleanup', postCleanupSchema)
|
||||
postCleanup: parseOrUndefinedJSON('post-cleanup', z.boolean())
|
||||
}
|
||||
core.debug(`Inputs: ${JSON.stringify(inputs)}`)
|
||||
validateInputs(inputs)
|
||||
@@ -193,4 +242,21 @@ const getOptions = () => {
|
||||
return options
|
||||
}
|
||||
|
||||
export const options = getOptions()
|
||||
let _options: Options
|
||||
try {
|
||||
_options = getOptions()
|
||||
} catch (error) {
|
||||
if (core.isDebug()) {
|
||||
throw error
|
||||
}
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(error.message)
|
||||
exit(1)
|
||||
} else if (typeof error === 'string') {
|
||||
core.setFailed(error)
|
||||
exit(1)
|
||||
}
|
||||
throw error
|
||||
}
|
||||
|
||||
export const options = _options
|
||||
|
||||
+83
-1
@@ -1 +1,83 @@
|
||||
console.log('post')
|
||||
import fs from 'fs/promises'
|
||||
import path from 'path'
|
||||
import * as os from 'os'
|
||||
import { exit } from 'process'
|
||||
import * as core from '@actions/core'
|
||||
import { options } from './options'
|
||||
|
||||
const removeEmptyParentDirs = (dirPath: string): Promise<void> => {
|
||||
return fs.readdir(dirPath).then((files) => {
|
||||
if (files.length === 0) {
|
||||
core.debug(`Removing empty directory ${dirPath}.`)
|
||||
return fs.rm(dirPath, { recursive: true }).then(() => {
|
||||
const parentDir = path.dirname(dirPath)
|
||||
if (parentDir !== dirPath) {
|
||||
return removeEmptyParentDirs(parentDir)
|
||||
}
|
||||
})
|
||||
}
|
||||
return Promise.resolve()
|
||||
})
|
||||
}
|
||||
|
||||
const cleanupPixiBin = () => {
|
||||
const pixiBinPath = options.pixiBinPath
|
||||
const pixiBinDir = path.dirname(pixiBinPath)
|
||||
core.debug(`Cleaning up pixi binary ${pixiBinPath}.`)
|
||||
return fs.rm(pixiBinPath).then(() => removeEmptyParentDirs(pixiBinDir))
|
||||
}
|
||||
|
||||
const cleanupEnv = () => {
|
||||
if (!options.runInstall) {
|
||||
core.debug('Skipping cleanup of .pixi directory.')
|
||||
return Promise.resolve()
|
||||
}
|
||||
const envDir = path.join(path.dirname(options.manifestPath), '.pixi')
|
||||
core.debug(`Cleaning up .pixi directory ${envDir}.`)
|
||||
return fs.rm(envDir, { recursive: true })
|
||||
}
|
||||
|
||||
const determineCacheDir = () => {
|
||||
// rattler uses dirs::cache_dir https://docs.rs/dirs/latest/dirs/fn.cache_dir.html
|
||||
if (os.platform() === 'win32') {
|
||||
return process.env.LOCALAPPDATA!
|
||||
}
|
||||
if (os.platform() === 'linux') {
|
||||
return process.env.XDG_CACHE_HOME ?? path.join(os.homedir(), '.cache')
|
||||
}
|
||||
return path.join(os.homedir(), 'Library', 'Caches')
|
||||
}
|
||||
|
||||
const cleanupRattler = () => {
|
||||
const rattlerPath = path.join(os.homedir(), '.rattler')
|
||||
const cacheDir = determineCacheDir()
|
||||
const rattlerCachePath = path.join(cacheDir, 'rattler')
|
||||
core.debug(`Cleaning up rattler directories ${rattlerPath} and ${rattlerCachePath}.`)
|
||||
return Promise.all([
|
||||
fs.rm(rattlerPath, { recursive: true, force: true }),
|
||||
fs.rm(rattlerCachePath, { recursive: true, force: true })
|
||||
])
|
||||
}
|
||||
|
||||
const run = () => {
|
||||
const postCleanup = options.postCleanup
|
||||
if (postCleanup) {
|
||||
return Promise.all([cleanupPixiBin(), cleanupEnv(), cleanupRattler()])
|
||||
}
|
||||
core.debug('Skipping post-cleanup.')
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
if (core.isDebug()) {
|
||||
throw error
|
||||
}
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(error.message)
|
||||
exit(1)
|
||||
} else if (typeof error === 'string') {
|
||||
core.setFailed(error)
|
||||
exit(1)
|
||||
}
|
||||
throw error
|
||||
})
|
||||
|
||||
+5
-5
@@ -79,18 +79,18 @@ export const pixiCmd = (command: string, withManifestPath = true) => {
|
||||
commandArray = commandArray.concat(['--manifest-path', options.manifestPath])
|
||||
}
|
||||
switch (options.logLevel) {
|
||||
case 'trace':
|
||||
case 'vvv':
|
||||
commandArray = commandArray.concat(['-vvv'])
|
||||
break
|
||||
case 'debug':
|
||||
case 'vv':
|
||||
commandArray = commandArray.concat(['-vv'])
|
||||
break
|
||||
case 'info':
|
||||
case 'v':
|
||||
commandArray = commandArray.concat(['-v'])
|
||||
break
|
||||
case 'warn':
|
||||
case 'default':
|
||||
break
|
||||
case 'quiet':
|
||||
case 'q':
|
||||
commandArray = commandArray.concat(['-q'])
|
||||
break
|
||||
}
|
||||
|
||||
+1693
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
[project]
|
||||
name = "test-auth"
|
||||
version = "0.1.0"
|
||||
description = "Add a short description here"
|
||||
authors = ["Pavel"]
|
||||
channels = ["conda-forge", "https://repo.prefix.dev/setup-pixi-test"]
|
||||
platforms = ["osx-arm64", "osx-64", "linux-64", "linux-aarch64", "win-64"]
|
||||
|
||||
[tasks]
|
||||
test = "python -c 'print(\"Hello world!\")'"
|
||||
|
||||
[dependencies]
|
||||
python = "3.9.*"
|
||||
private-package = "*"
|
||||
@@ -7,6 +7,7 @@ channels = ["conda-forge"]
|
||||
platforms = ["linux-64", "osx-64", "win-64"]
|
||||
|
||||
[tasks]
|
||||
test = "python -c 'print(\"Hello world!\")'"
|
||||
|
||||
[dependencies]
|
||||
python = "3.11.*"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
[project]
|
||||
name = "test-default"
|
||||
version = "0.1.0"
|
||||
description = "Add a short description here"
|
||||
authors = ["Pavel Zwerschke <pavelzw@gmail.com>"]
|
||||
channels = ["conda-forge"]
|
||||
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
|
||||
|
||||
[tasks]
|
||||
test = "python -c 'print(\"Hello world!\")'"
|
||||
|
||||
[dependencies]
|
||||
# the lockfile still has python 3.10.*
|
||||
python = "3.11.*"
|
||||
@@ -7,6 +7,7 @@ channels = ["conda-forge"]
|
||||
platforms = ["linux-64", "osx-64", "win-64"]
|
||||
|
||||
[tasks]
|
||||
test = "python -c 'print(\"Hello world!\")'"
|
||||
|
||||
[dependencies]
|
||||
python = "3.11.*"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2023, Pavel Zwerschke
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,28 @@
|
||||
package:
|
||||
name: private-package
|
||||
version: 0.0.1
|
||||
|
||||
build:
|
||||
noarch: python
|
||||
script: echo this is a noop
|
||||
number: 0
|
||||
|
||||
requirements:
|
||||
run:
|
||||
- python >=3.9
|
||||
|
||||
test:
|
||||
commands:
|
||||
- echo this is a noop
|
||||
|
||||
about:
|
||||
home: http://github.com/prefix-dev/setup-pixi
|
||||
license: BSD-3-Clause
|
||||
license_file: LICENSE
|
||||
description: |
|
||||
This is a test package for setup-pixi.
|
||||
dev_url: http://github.com/prefix-dev/setup-pixi
|
||||
|
||||
extra:
|
||||
recipe-maintainers:
|
||||
- pavelzw
|
||||
Reference in New Issue
Block a user