diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f711c8..f6d661d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - run: npm run build:ci --workspace cli - name: Get current package version id: current_version - run: echo "version=$(grep '.version =' build.zig.zon | sed 's/.*.version = "\([^"]*\)".*/\1/')" >> $GITHUB_OUTPUT + run: echo "version=$(./scripts/version.sh)" >> $GITHUB_OUTPUT working-directory: apps/cli - uses: mukunku/tag-exists-action@v1.4.0 id: check_tag diff --git a/apps/cli/scripts/version.sh b/apps/cli/scripts/version.sh new file mode 100755 index 0000000..6de23f0 --- /dev/null +++ b/apps/cli/scripts/version.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +ARCH=$(uname -m) +if [ "${ARCH}" = "arm64" ]; then + ARCH="aarch64" +fi + +BIN_DIR=$(find zig-out -type d -name "${ARCH}*" | head -n 1) +BIN="${BIN_DIR}/genmoji" + +if [ -f "${BIN}" ]; then + echo $(./$BIN --version | awk -F' ' '{print $3}' | tr -d '"') +else + exit 1 +fi