Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release publishing workflows #72

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ jobs:

- name: List files
run: file output/*

- name: Cleanup
run: rm output/*
6 changes: 5 additions & 1 deletion .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: Build Docker images

on: [pull_request]
on:
pull_request_review:
types: [submitted]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
# Build image only if PR is approved to avoid having too many random images
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-release-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ jobs:
with:
files: "output/*"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup
run: rm output/*
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,19 @@ test: $(VENDOR_DIR)
.PHONY: build-ubuntu-latest
build-ubuntu-latest: $(VENDOR_DIR) $(OUTPUT_DIR)
CGO_ENABLED=1 go build -a -ldflags '-extldflags "-static"' -o output/minigun .
tar czf output/minigun-linux-amd64.tar.gz output/minigun
rm -f output/minigun
cd output && file minigun && tar czf minigun-linux-amd64.tar.gz minigun && rm -f minigun
GOARCH=arm64 CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o output/minigun .
tar czf output/minigun-linux-arm64.tar.gz output/minigun
rm -f output/minigun
cd output && file minigun && tar czf minigun-linux-arm64.tar.gz minigun && rm -f minigun

.PHONY: build-macos-latest
build-macos-latest: $(VENDOR_DIR) $(OUTPUT_DIR)
CGO_ENABLED=1 go build -a -ldflags '-extldflags "-static"' -o output/minigun .
tar czf output/minigun-darwin-amd64.tar.gz output/minigun
cd output && file minigun && tar czf minigun-darwin-amd64.tar.gz minigun && rm -f minigun
rm -f output/minigun
GOARCH=arm64 CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o output/minigun .
tar czf output/minigun-darwin-arm64.tar.gz output/minigun
rm -f output/minigun
cd output && file minigun && tar czf minigun-darwin-arm64.tar.gz minigun && rm -f minigun

.PHONY: build-windows-latest
build-windows-latest: $(VENDOR_DIR) $(OUTPUT_DIR)
CGO_ENABLED=1 go build -a -ldflags '-extldflags "-static"' -o output/minigun.exe .
tar czf output/minigun-win64.tar.gz output/minigun.exe
rm -f output/minigun.exe
cd output && tar czf minigun-win64.tar.gz minigun.exe && rm -f minigun.exe
Loading