-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
71 lines (60 loc) · 2.05 KB
/
action.yaml
File metadata and controls
71 lines (60 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Pixi-Pack action using 'pixi-build-python'
description: 🧚💛🐍 A "pixi-pack" action using "pixi-build-python".
author: ehrenfeu
branding:
icon: package
color: purple
inputs:
environment:
description: "Name of the environment to pack (optional, will use 'default' if not specified)."
required: false
default: 'default'
platform:
description: "Target platform for the environment (e.g., 'linux-64', 'osx-64', 'win-64')."
required: false
version:
description: "Version string to embed in the output filename (optional, defaults to `github.ref_name`)."
default: ""
pixi-pack-version:
description: "Version of pixi-pack to use (default: '0.7.6')."
required: false
default: '0.7.6'
runs:
using: "composite"
steps:
- name: Install Pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
pixi-version: v0.67.2
cache: true
- name: Install pixi-pack
run: pixi global install pixi-pack==${{ inputs.pixi-pack-version }}
shell: bash
- name: Run pixi-pack
run: |
echo "==> Packing environment for platform: ${{ inputs.platform }}"
PACK_CMD="pixi-pack --environment '${{ inputs.environment }}' --create-executable "
if [ -n "${{ inputs.platform }}" ]; then
echo "Adding --platform flag: ${{ inputs.platform }}"
PACK_CMD="$PACK_CMD --platform '${{ inputs.platform }}'"
fi
echo "Running: $PACK_CMD"
eval "$PACK_CMD"
shell: bash
- name: Rename output file
run: |
OUTPUT_FILE=$(ls -1 | grep -E 'environment\.(sh|ps1)' | head -n 1)
if [ -z "$OUTPUT_FILE" ]; then
echo "No output file found matching pattern"
exit 1
fi
VERSION="${{ inputs.version }}"
if [ -z "$VERSION" ]; then
VERSION="${{ github.ref_name }}"
fi
filename=$(basename -- "$OUTPUT_FILE")
extension="${filename##*.}"
NEW_NAME="${{ github.event.repository.name }}-$VERSION-${{ inputs.platform }}.${extension}"
echo "Renaming $OUTPUT_FILE → $NEW_NAME"
mv "$OUTPUT_FILE" "$NEW_NAME"
shell: bash