Skip to content
This repository was archived by the owner on Jun 13, 2026. It is now read-only.

Commit 724cd06

Browse files
committed
Fix GHCR push permissions and add local build testing
- Update release workflow to use GHCR_PAT for package push - Add justfile recipes for local build testing: - build-test: test single-platform build without push - build-dev: build and push dev image - build-test-multi: test multi-platform build - build-release: production release workflow - build-check: verify build configuration - ghcr-login: login helper for local testing - ghcr-test-login: test registry access
1 parent 4498ce1 commit 724cd06

2 files changed

Lines changed: 58 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
with:
7575
registry: ${{ env.REGISTRY }}
7676
username: ${{ github.actor }}
77-
password: ${{ secrets.GITHUB_TOKEN }}
77+
password: ${{ secrets.GHCR_PAT || secrets.GITHUB_TOKEN }}
7878

7979
- name: Determine version
8080
id: version

justfile

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,64 @@ docker-run-delete:
106106
docker-test:
107107
./test_container.sh
108108

109-
# Build multi-platform Docker images
109+
# Build multi-platform Docker images and push to registry
110110
docker-build-multi:
111-
uv run build.py build --push
111+
uv run build.py --push
112+
113+
# Test build locally without pushing (single platform, faster)
114+
build-test:
115+
@echo "🔨 Testing local build (linux/amd64 only, no push)..."
116+
uv run build.py --dev --platforms linux/amd64 --skip-push
117+
118+
# Test build and push to your personal registry (dev mode)
119+
build-dev:
120+
@echo "🔨 Building and pushing dev image..."
121+
@echo "ℹ️ This will push to ghcr.io/{{`git config user.name | tr '[:upper:]' '[:lower:]'`}}/sensor-log-generator:dev"
122+
PUSH_TO_REGISTRY=true uv run build.py --dev --platforms linux/amd64
123+
124+
# Test full multi-platform build locally (no push)
125+
build-test-multi:
126+
@echo "🔨 Testing full multi-platform build (no push)..."
127+
@echo "⚠️ This will take several minutes..."
128+
uv run build.py --platforms linux/amd64,linux/arm64 --skip-push
129+
130+
# Build and push production release (requires version tag)
131+
build-release VERSION:
132+
@echo "🚀 Building and pushing release v{{VERSION}}..."
133+
@echo "⚠️ This will create git tags and push to registry"
134+
@read -p "Continue? (y/N) " confirm && [ "$$confirm" = "y" ] || exit 1
135+
PUSH_TO_REGISTRY=true uv run build.py --version-tag {{VERSION}}
136+
137+
# Test the build script configuration without building
138+
build-check:
139+
@echo "🔍 Checking build configuration..."
140+
@echo ""
141+
@echo "Git remote:"
142+
@git remote get-url origin || echo "No git remote configured"
143+
@echo ""
144+
@echo "Current version:"
145+
@git describe --tags --abbrev=0 2>/dev/null || echo "No tags found"
146+
@echo ""
147+
@echo "Will build as:"
148+
@uv run -s build.py --help | head -20
149+
@echo ""
150+
@echo "Docker buildx builders:"
151+
@docker buildx ls || echo "Docker buildx not available"
152+
153+
# Login to GitHub Container Registry for local testing
154+
ghcr-login:
155+
@echo "🔐 Logging into GitHub Container Registry..."
156+
@echo "ℹ️ You need a GitHub Personal Access Token with write:packages scope"
157+
@echo "ℹ️ Create one at: https://github.com/settings/tokens/new"
158+
@echo ""
159+
@read -p "Enter your GitHub username: " username && \
160+
echo "$$GITHUB_TOKEN" | docker login ghcr.io -u "$$username" --password-stdin
161+
162+
# Test docker login status
163+
ghcr-test-login:
164+
@echo "🔍 Testing GitHub Container Registry access..."
165+
@docker pull ghcr.io/bacalhau-project/sensor-log-generator:latest 2>&1 | \
166+
grep -q "denied" && echo "❌ Not logged in or no access" || echo "✅ Access confirmed"
112167

113168
# Clean up generated files and caches
114169
clean:

0 commit comments

Comments
 (0)