···33# This workflow builds the docker-credential-atcr binary and publishes it
44# to Tangled.org for distribution via Homebrew.
55#
66-# Current limitation: Tangled doesn't support triggering on tags yet,
77-# so this triggers on push to main. Manually verify you've tagged the
88-# release before pushing.
66+# Triggers on version tags (v*) pushed to the repository.
97108when:
1111- - event: ["manual"]
1212- branch: ["main"]
99+ - event: ["push"]
1010+ tag: ["v*"]
13111412engine: "nixery"
15131614dependencies:
1715 nixpkgs:
1816 - go_1_24 # Go 1.24+ for building
1919- - git # For finding tags
2017 - goreleaser # For building multi-platform binaries
1818+ - curl # Required by go generate for downloading vendor assets
1919+ - gnugrep # Required for tag detection
2120 # - goat # TODO: Add goat CLI for uploading to Tangled (if available in nixpkgs)
22212322environment:
2423 CGO_ENABLED: "0" # Build static binaries
25242625steps:
2727- - name: Find latest git tag
2626+ - name: Get tag for current commit
2827 command: |
2929- # Get the most recent version tag
3030- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")
3131- echo "Latest tag: $LATEST_TAG"
3232- echo "$LATEST_TAG" > .version
2828+ # Fetch tags (shallow clone doesn't include them by default)
2929+ git fetch --tags
3030+3131+ # Find the tag that points to the current commit
3232+ TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]' | head -n1)
3333+3434+ if [ -z "$TAG" ]; then
3535+ echo "Error: No version tag found for current commit"
3636+ echo "Available tags:"
3737+ git tag
3838+ echo "Current commit:"
3939+ git rev-parse HEAD
4040+ exit 1
4141+ fi
4242+4343+ echo "Building version: $TAG"
4444+ echo "$TAG" > .version
33453446 # Also get the commit hash for reference
3547 COMMIT_HASH=$(git rev-parse HEAD)
···47594860 # List what was built
4961 echo "Built artifacts:"
5050- ls -lh dist/
6262+ if [ -d "dist" ]; then
6363+ ls -lh dist/
6464+ else
6565+ echo "Error: dist/ directory was not created by GoReleaser"
6666+ exit 1
6767+ fi
51685269 - name: Package artifacts
5370 command: |
+26-3
.tangled/workflows/release.yml
···3344when:
55 - event: ["manual"]
66- # TODO: Trigger only on version tags (v1.0.0, v2.1.3, etc.)
77- branch: ["main"]
66+ tag: ["v*"]
8798engine: "nixery"
1091110dependencies:
1211 nixpkgs:
1312 - buildah
1414- - chroot
1313+ - gnugrep # Required for tag detection
15141615environment:
1716 IMAGE_REGISTRY: atcr.io
1817 IMAGE_USER: evan.jarrett.net
19182019steps:
2020+ - name: Get tag for current commit
2121+ command: |
2222+ # Fetch tags (shallow clone doesn't include them by default)
2323+ git fetch --tags
2424+2525+ # Find the tag that points to the current commit
2626+ TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]' | head -n1)
2727+2828+ if [ -z "$TAG" ]; then
2929+ echo "Error: No version tag found for current commit"
3030+ echo "Available tags:"
3131+ git tag
3232+ echo "Current commit:"
3333+ git rev-parse HEAD
3434+ exit 1
3535+ fi
3636+3737+ echo "Building version: $TAG"
3838+ echo "$TAG" > .version
3939+2140 - name: Setup build environment
2241 command: |
2342 if ! grep -q "^root:" /etc/passwd 2>/dev/null; then
···34533554 - name: Build and push AppView image
3655 command: |
5656+ TAG=$(cat .version)
5757+3758 buildah bud \
3859 --storage-driver vfs \
3960 --tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:${TAG} \
···47684869 - name: Build and push Hold image
4970 command: |
7171+ TAG=$(cat .version)
7272+5073 buildah bud \
5174 --storage-driver vfs \
5275 --tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:${TAG} \