Skip to content

Commit

Permalink
fix versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
cdzombak committed May 30, 2024
1 parent 727773e commit aa0b9fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:

homebrew:
name: Update Homebrew Tap
needs: [meta, binaries]
needs: [meta, binaries, release]
if: needs.meta.outputs.is_release == 'true'
runs-on: ubuntu-latest
steps:
Expand All @@ -191,7 +191,7 @@ jobs:
target_linux_arm64: false
version: v${{ needs.meta.outputs.bin_version }}
install: 'bin.install "${{ needs.meta.outputs.bin_name }}"'
test: 'assert_match("${{ needs.meta.outputs.bin_version }}", shell_output("#{bin}/${{ needs.meta.outputs.bin_name }} -version"))'
test: 'assert_match("${{ needs.meta.outputs.bin_version }}", shell_output("#{bin}/${{ needs.meta.outputs.bin_name }} version"))'

ntfy:
name: Ntfy
Expand Down
8 changes: 8 additions & 0 deletions .version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

if [ -z "$(git tag --points-at HEAD)" ]; then
git describe --always --long --dirty | sed 's/^v//'
else
git tag --points-at HEAD | sed 's/^v//' | awk '{ print length, $0 }' | sort -n -s | cut -d" " -f2- | tail -n 1
fi
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SHELL:=/usr/bin/env bash

BIN_VERSION:=$(shell [ -z "$$(git tag --points-at HEAD)" ] && echo "$$(git describe --always --long --dirty | sed 's/^v//')" || echo "$$(git tag --points-at HEAD | sed 's/^v//')")
X3F_EXTRACT_VERSION:=$(shell ./x3f_extract 2>/dev/null | grep -i "VERSION =" | rev | cut -d' ' -f1 | rev)
BIN_NAME:=xtool
BIN_VERSION:=$(shell ./.version.sh)
X3F_EXTRACT_VERSION:=$(shell ./x3f_extract 2>/dev/null | grep -i "VERSION =" | rev | cut -d' ' -f1 | rev)

default: help
.PHONY: help
Expand Down

0 comments on commit aa0b9fc

Please sign in to comment.