mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-29 12:17:00 +00:00
test tag push
This commit is contained in:
@@ -3,33 +3,45 @@
|
||||
# This workflow builds the docker-credential-atcr binary and publishes it
|
||||
# to Tangled.org for distribution via Homebrew.
|
||||
#
|
||||
# Current limitation: Tangled doesn't support triggering on tags yet,
|
||||
# so this triggers on push to main. Manually verify you've tagged the
|
||||
# release before pushing.
|
||||
# Triggers on version tags (v*) pushed to the repository.
|
||||
|
||||
when:
|
||||
- event: ["manual"]
|
||||
branch: ["main"]
|
||||
- event: ["push"]
|
||||
tag: ["v*"]
|
||||
|
||||
engine: "nixery"
|
||||
|
||||
dependencies:
|
||||
nixpkgs:
|
||||
- go_1_24 # Go 1.24+ for building
|
||||
- git # For finding tags
|
||||
- goreleaser # For building multi-platform binaries
|
||||
- curl # Required by go generate for downloading vendor assets
|
||||
- gnugrep # Required for tag detection
|
||||
# - goat # TODO: Add goat CLI for uploading to Tangled (if available in nixpkgs)
|
||||
|
||||
environment:
|
||||
CGO_ENABLED: "0" # Build static binaries
|
||||
|
||||
steps:
|
||||
- name: Find latest git tag
|
||||
- name: Get tag for current commit
|
||||
command: |
|
||||
# Get the most recent version tag
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")
|
||||
echo "Latest tag: $LATEST_TAG"
|
||||
echo "$LATEST_TAG" > .version
|
||||
# Fetch tags (shallow clone doesn't include them by default)
|
||||
git fetch --tags
|
||||
|
||||
# Find the tag that points to the current commit
|
||||
TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]' | head -n1)
|
||||
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "Error: No version tag found for current commit"
|
||||
echo "Available tags:"
|
||||
git tag
|
||||
echo "Current commit:"
|
||||
git rev-parse HEAD
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building version: $TAG"
|
||||
echo "$TAG" > .version
|
||||
|
||||
# Also get the commit hash for reference
|
||||
COMMIT_HASH=$(git rev-parse HEAD)
|
||||
@@ -47,7 +59,12 @@ steps:
|
||||
|
||||
# List what was built
|
||||
echo "Built artifacts:"
|
||||
ls -lh dist/
|
||||
if [ -d "dist" ]; then
|
||||
ls -lh dist/
|
||||
else
|
||||
echo "Error: dist/ directory was not created by GoReleaser"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Package artifacts
|
||||
command: |
|
||||
|
||||
@@ -3,21 +3,40 @@
|
||||
|
||||
when:
|
||||
- event: ["manual"]
|
||||
# TODO: Trigger only on version tags (v1.0.0, v2.1.3, etc.)
|
||||
branch: ["main"]
|
||||
tag: ["v*"]
|
||||
|
||||
engine: "nixery"
|
||||
|
||||
dependencies:
|
||||
nixpkgs:
|
||||
- buildah
|
||||
- chroot
|
||||
- gnugrep # Required for tag detection
|
||||
|
||||
environment:
|
||||
IMAGE_REGISTRY: atcr.io
|
||||
IMAGE_USER: evan.jarrett.net
|
||||
|
||||
steps:
|
||||
- name: Get tag for current commit
|
||||
command: |
|
||||
# Fetch tags (shallow clone doesn't include them by default)
|
||||
git fetch --tags
|
||||
|
||||
# Find the tag that points to the current commit
|
||||
TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]' | head -n1)
|
||||
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "Error: No version tag found for current commit"
|
||||
echo "Available tags:"
|
||||
git tag
|
||||
echo "Current commit:"
|
||||
git rev-parse HEAD
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building version: $TAG"
|
||||
echo "$TAG" > .version
|
||||
|
||||
- name: Setup build environment
|
||||
command: |
|
||||
if ! grep -q "^root:" /etc/passwd 2>/dev/null; then
|
||||
@@ -34,6 +53,8 @@ steps:
|
||||
|
||||
- name: Build and push AppView image
|
||||
command: |
|
||||
TAG=$(cat .version)
|
||||
|
||||
buildah bud \
|
||||
--storage-driver vfs \
|
||||
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:${TAG} \
|
||||
@@ -47,6 +68,8 @@ steps:
|
||||
|
||||
- name: Build and push Hold image
|
||||
command: |
|
||||
TAG=$(cat .version)
|
||||
|
||||
buildah bud \
|
||||
--storage-driver vfs \
|
||||
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:${TAG} \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
when:
|
||||
- event: ["push"]
|
||||
branch: ["main"]
|
||||
branch: ["main", "test"]
|
||||
- event: ["pull_request"]
|
||||
branch: ["main"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user