minor refactor

- simplify CSV reading logic
- add more comments
- rework the packaging script
- remove debug information for git tags
This commit is contained in:
Jonatan Czarniecki 2025-06-08 15:57:24 +02:00
parent e21cbd1f63
commit cbb31f2183
No known key found for this signature in database
GPG key ID: 8B5FB251A803BDD0
6 changed files with 87 additions and 31 deletions

View file

@ -17,9 +17,15 @@ runs:
steps:
- name: Convert input targets to Bash array
# read comma-separated list of targets, converts it to
# an array of arguments for cargo-zigbuild like this:
# [ "--target", "<target1>", "--target", "<target2>", ... ]
shell: bash
run: |
readarray -d $'\0' -t targets < <(awk -F, '{ for (i = 1; i <= NF; i++) printf "--target\0%s\0", $i }' <<< "${{ inputs.targets }}")
targets=()
while IFS=',' read -r target
do targets+=("--target" "$target")
done <<< "${{ inputs.targets }}"
declare -p targets > /tmp/targets.sh
- name: Check with cargo-fmt
@ -27,7 +33,7 @@ runs:
shell: sh
run: cargo fmt -v --all -- --check
- name: Run Clippy
- name: Run Clippy with cargo-zigbuild
if: inputs.lint == true
shell: bash
run: |

View file

@ -12,6 +12,13 @@ runs:
- 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"