种植日期: 2026-01-11
上次照料: 2026-01-12
2026-01-11
action
在 cicd 流水线里使用 Guix 环境:
action.yml
name: 'Guix Environment Setup'
description: 'Export GNU Guix shell environment variables to GITHUB_ENV'
inputs:
manifest:
description: 'Path to the Guix manifest file'
required: true
default: 'manifest.scm'
guix-bin:
description: 'Path to the guix binary'
required: false
default: '/var/guix/profiles/per-user/root/current-guix/bin/guix'
daemon-socket:
description: 'Guix daemon socket address'
required: false
default: 'guix://172.17.0.1'
runs:
using: "composite"
steps:
- name: Export Guix Environment
shell: bash
env:
GUIX_DAEMON_SOCKET: ${{ inputs.daemon-socket }}
run: |
${{ inputs.guix-bin }} shell -m ${{ inputs.manifest }} --search-paths > guix_paths.sh
while read -r line; do
if [[ $line == export* ]]; then
content=${line#export }
echo "$content" >> $GITHUB_ENV
fi
done < guix_paths.sh
echo "Guix environment variables have been injected into GITHUB_ENV."
评论