diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index b86bd42..907aef7 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -11,7 +11,7 @@ runs: # Hardcode version to 0.0.0 to have a stable hash when dependencies have not changed toml set Cargo.toml package.version "0.0.0" > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml cargo update --package ${GITHUB_REPOSITORY#*/} - HASH=$(cat Cargo.toml Cargo.lock flake.nix flake.lock | hashsum --sha256 --no-names) + HASH=$(cat Cargo.toml Cargo.lock flake.nix flake.lock | sha256sum | cut -d ' ' -f1) git checkout -- Cargo.toml Cargo.lock echo "hash=$HASH" echo "hash=$HASH" >> $GITHUB_OUTPUT diff --git a/.github/actions/semver-label/action.yml b/.github/actions/semver-label/action.yml index 61ab9ed..0e52d89 100644 --- a/.github/actions/semver-label/action.yml +++ b/.github/actions/semver-label/action.yml @@ -82,7 +82,7 @@ runs: GH_TOKEN: ${{ github.token }} run: | if [ -f Cargo.toml ]; then - version=$(yq '.package.version' Cargo.toml) + version=$(toml get Cargo.toml package.version --raw) else version=$(gh release view --json name -q '.name' 2>/dev/null || echo '0.0.0') fi diff --git a/.release/action/values.sh b/.release/action/values.sh index 5aeb83f..0580ed6 100755 --- a/.release/action/values.sh +++ b/.release/action/values.sh @@ -9,5 +9,5 @@ capture() { capture PKG_FILENAME action capture PKG_EXTENSION yml repo_root="$(git rev-parse --show-toplevel)" -version="$(yq -p toml -oy '.package.version' "$repo_root/Cargo.toml")" +version="$(toml get "$repo_root/Cargo.toml" package.version --raw)" capture PKG_VERSION "$version" diff --git a/.release/brew/values.sh b/.release/brew/values.sh index bfec219..05c60b4 100755 --- a/.release/brew/values.sh +++ b/.release/brew/values.sh @@ -10,14 +10,14 @@ repo="${GITHUB_REPOSITORY##*/}" capture PKG_FILENAME "$repo" capture PKG_EXTENSION rb capture PKG_REPO "$repo" -class="$(echo "$repo" | awk -F'-' '{for(i=1;i<=NF;i++) printf "%s%s", toupper(substr($i,1,1)), substr($i,2)}')" +class="$(echo "$repo" | gawk -F'-' '{for(i=1;i<=NF;i++) printf "%s%s", toupper(substr($i,1,1)), substr($i,2)}')" capture PKG_CLASS "$class" desc="$(gh repo view --json description --jq .description)" capture PKG_DESC "$desc" homepage="$(gh api "repos/$GITHUB_REPOSITORY" --jq .homepage)" capture PKG_HOMEPAGE "$homepage" repo_root="$(git rev-parse --show-toplevel)" -version="$(yq -p toml -oy '.package.version' "$repo_root/Cargo.toml")" +version="$(toml get "$repo_root/Cargo.toml" package.version --raw)" capture PKG_VERSION "$version" capture PKG_OWNER "${GITHUB_REPOSITORY%%/*}" @@ -36,9 +36,9 @@ gh release download "$tag" --pattern "$pattern" --clobber for archive in $pattern; do echo "# $archive" done -mac_arm_sha="$([[ -f "$repo-aarch64-apple-darwin.tar.gz" ]] && hashsum --sha256 "$repo-aarch64-apple-darwin.tar.gz" --no-names || echo "TBD")" +mac_arm_sha="$([[ -f "$repo-aarch64-apple-darwin.tar.gz" ]] && sha256sum "$repo-aarch64-apple-darwin.tar.gz" | cut -d ' ' -f1 || echo "TBD")" capture PKG_MAC_ARM_SHA "$mac_arm_sha" -linux_arm_sha="$([[ -f "$repo-aarch64-unknown-linux-musl.tar.gz" ]] && hashsum --sha256 "$repo-aarch64-unknown-linux-musl.tar.gz" --no-names || echo "TBD")" +linux_arm_sha="$([[ -f "$repo-aarch64-unknown-linux-musl.tar.gz" ]] && sha256sum "$repo-aarch64-unknown-linux-musl.tar.gz" | cut -d ' ' -f1 || echo "TBD")" capture PKG_LINUX_ARM_SHA "$linux_arm_sha" -linux_intel_sha="$([[ -f "$repo-x86_64-unknown-linux-musl.tar.gz" ]] && hashsum --sha256 "$repo-x86_64-unknown-linux-musl.tar.gz" --no-names || echo "TBD")" +linux_intel_sha="$([[ -f "$repo-x86_64-unknown-linux-musl.tar.gz" ]] && sha256sum "$repo-x86_64-unknown-linux-musl.tar.gz" | cut -d ' ' -f1 || echo "TBD")" capture PKG_LINUX_INTEL_SHA "$linux_intel_sha" diff --git a/.release/nix/values.sh b/.release/nix/values.sh index 5242c42..05d7fc5 100755 --- a/.release/nix/values.sh +++ b/.release/nix/values.sh @@ -11,7 +11,7 @@ capture PKG_FILENAME "default" capture PKG_EXTENSION nix capture PKG_REPO "$repo" repo_root="$(git rev-parse --show-toplevel)" -version="$(yq -p toml -oy '.package.version' "$repo_root/Cargo.toml")" +version="$(toml get "$repo_root/Cargo.toml" package.version --raw)" capture PKG_VERSION "$version" capture PKG_OWNER "${GITHUB_REPOSITORY%%/*}" capture PKG_REV "$GITHUB_SHA" diff --git a/.release/render.sh b/.release/render.sh index f512254..f4fd1a0 100755 --- a/.release/render.sh +++ b/.release/render.sh @@ -36,7 +36,7 @@ mock_github_actions_env() { export GITHUB_REPOSITORY="$owner/$repo" repo_root="$(git rev-parse --show-toplevel)" - tag="v$(yq -p toml -oy '.package.version' "$repo_root/Cargo.toml")" + tag="v$(toml get "$repo_root/Cargo.toml" package.version --raw)" if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$tag" &>/dev/null; then rev="$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$tag" --jq '.object.sha')" else diff --git a/flake.nix b/flake.nix index 3f13f1c..19f9387 100644 --- a/flake.nix +++ b/flake.nix @@ -60,26 +60,24 @@ editorconfig-checker (python313.withPackages ( ps: with ps; [ - mkdocs-material + mkdocs-material # TODO: switch to zensical. Note that find-changes action is python-based, so that needs to be rewritten. ] )) prettier rubocop shellcheck gh - yq-go - ripgrep # Everything below is required by GitHub Actions - uutils-coreutils-noprefix + coreutils bash - git + gitMinimal # With plain 'git' perl etc. get bundled in findutils gnutar curl jq gzip envsubst - gawkInteractive + gawk xz gnugrep ];