Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7537896
action.yml
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
action.yml
View Options
name
:
Setup Zig
description
:
Install Zig compiler
inputs
:
version
:
description
:
Zig version
required
:
true
runs
:
using
:
composite
steps
:
-
name
:
Determine platform
id
:
platform
shell
:
bash
run
:
|
case "${{ runner.os }}-${{ runner.arch }}" in
Linux-X64) echo "slug=x86_64-linux" >> $GITHUB_OUTPUT; echo "ext=tar.xz" >> $GITHUB_OUTPUT ;;
Linux-ARM64) echo "slug=aarch64-linux" >> $GITHUB_OUTPUT; echo "ext=tar.xz" >> $GITHUB_OUTPUT ;;
macOS-X64) echo "slug=x86_64-macos" >> $GITHUB_OUTPUT; echo "ext=tar.xz" >> $GITHUB_OUTPUT ;;
macOS-ARM64) echo "slug=aarch64-macos" >> $GITHUB_OUTPUT; echo "ext=tar.xz" >> $GITHUB_OUTPUT ;;
Windows-X64) echo "slug=x86_64-windows" >> $GITHUB_OUTPUT; echo "ext=zip" >> $GITHUB_OUTPUT ;;
*) echo "Unsupported platform: ${{ runner.os }}-${{ runner.arch }}" >&2; exit 1 ;;
esac
echo "install_path=$RUNNER_TEMP/zig" >> $GITHUB_OUTPUT
-
name
:
Cache Zig
id
:
cache
uses
:
actions/cache@v4
with
:
path
:
${{ steps.platform.outputs.install_path }}
key
:
zig-${{ steps.platform.outputs.slug }}-${{ inputs.version }}
-
name
:
Download and install Zig
if
:
steps.cache.outputs.cache-hit != 'true'
shell
:
bash
run
:
|
cd "$RUNNER_TEMP"
URL="https://ziglang.org/download/${{ inputs.version }}/zig-${{ steps.platform.outputs.slug }}-${{ inputs.version }}.${{ steps.platform.outputs.ext }}"
echo "Downloading: $URL"
curl -fSL -o zig.${{ steps.platform.outputs.ext }} "$URL"
ls -la zig.${{ steps.platform.outputs.ext }}
if [[ "${{ steps.platform.outputs.ext }}" == "zip" ]]; then
unzip -q zig.${{ steps.platform.outputs.ext }}
else
tar -xJf zig.${{ steps.platform.outputs.ext }}
fi
INSTALL_PATH="${{ steps.platform.outputs.install_path }}"
mkdir -p "$(dirname "$INSTALL_PATH")"
mv zig-${{ steps.platform.outputs.slug }}-${{ inputs.version }} "$INSTALL_PATH"
-
name
:
Add to PATH
shell
:
bash
run
:
echo "${{ steps.platform.outputs.install_path }}" >> $GITHUB_PATH
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 17, 12:45 PM (20 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
568077
Default Alt Text
action.yml (2 KB)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment