mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 13:01:12 +03:00
use mlugg/setup-zig action to install Zig instead of doing it manually
This commit is contained in:
parent
63b2ca88c7
commit
badd43320d
2 changed files with 8 additions and 25 deletions
3
.github/actions/build/action.yml
vendored
3
.github/actions/build/action.yml
vendored
|
|
@ -5,12 +5,15 @@ inputs:
|
|||
targets:
|
||||
description: A comma-separated list of Rust targets.
|
||||
default: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-pc-windows-gnu
|
||||
required: true
|
||||
lint:
|
||||
description: A boolean indicating if linting (cargo-fmt, clippy) should be run
|
||||
default: true
|
||||
required: true
|
||||
test:
|
||||
description: A boolean indicating if tests should be run
|
||||
default: true
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
|
|
|||
30
.github/actions/dependencies/action.yml
vendored
30
.github/actions/dependencies/action.yml
vendored
|
|
@ -1,38 +1,18 @@
|
|||
name: Install cargo-zigbuild
|
||||
description: Installs cargo-zigbuild and its dependencies
|
||||
name: Install dependencies
|
||||
description: Installs Zig and cargo-zigbuild
|
||||
|
||||
inputs:
|
||||
zig-version:
|
||||
description: Version of Zig to install
|
||||
default: 0.14.1
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
||||
- name: Install Zig
|
||||
shell: bash
|
||||
# the `--transform` options are used to install Zig in the /usr/local/:
|
||||
# */zig -> /usr/local/bin/zig
|
||||
# */lib/ -> /usr/local/lib/zig/
|
||||
# the rest is not really necessary, but for consistency:
|
||||
# */doc/ -> /usr/local/share/doc/zig/
|
||||
# */LICENSE -> /usr/local/share/doc/zig/copyright
|
||||
# */README.md -> /usr/local/share/doc/zig/README.md
|
||||
run: |
|
||||
ZIG_VERSION="${{ inputs.zig-version }}"
|
||||
[ "$RUNNER_ARCH" == "X64" ] && ZIG_ARCH="x86_64" || ZIG_ARCH="aarch64"
|
||||
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-${ZIG_ARCH}-linux-${ZIG_VERSION}.tar.xz" \
|
||||
-O /tmp/zig.tar.xz
|
||||
|
||||
sudo tar -xJf /tmp/zig.tar.xz -C / \
|
||||
--transform='s|^[^/]+/zig$|usr/local/bin/zig|x' \
|
||||
--transform='s|^[^/]+/lib|usr/local/lib/zig|x' \
|
||||
--transform='s|^[^/]+/doc|usr/local/share/doc/zig|x' \
|
||||
--transform='s|^[^/]+/LICENSE$|usr/local/share/doc/zig/copyright|x' \
|
||||
--transform='s|^[^/]+/README.md$|usr/local/share/doc/zig/README.md|x' \
|
||||
--wildcards \
|
||||
"*/"{zig,lib,doc,LICENSE,README.md}
|
||||
uses: mlugg/setup-zig@v2
|
||||
with:
|
||||
version: ${{ inputs.zig-version }}
|
||||
|
||||
- name: Install cargo-zigbuild
|
||||
shell: sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue