Skip to content
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
9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,12 @@ jobs:
- name: Build binary
run: make release-${{ matrix.goos }}-${{ matrix.goarch }}

- name: Generate SHA256 checksum
run: make checksums

- name: Upload binaries
uses: actions/upload-artifact@v5
with:
name: backup-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/backup-${{ matrix.goos }}-${{ matrix.goarch }}

- name: Upload SHA256 checksum files
uses: actions/upload-artifact@v5
with:
name: sha256-checksums-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*.sha256

release:
name: Publish Release
needs: build
Expand Down
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BUILD_CMD = CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -tags=prod
PACKAGE = ./backup/main.go
COVERAGE_THRESHOLD = 98

.PHONY: build clean test test-integration lint tidy checksums release sanity-check check-mod-tidy lint-config-check lint-fix format check-clean check-coverage
.PHONY: build clean test test-integration lint tidy release sanity-check check-mod-tidy lint-config-check lint-fix format check-clean check-coverage

format:
go fmt ./...
Expand Down Expand Up @@ -55,21 +55,13 @@ release-%:
@mkdir -p dist
GOOS=$(word 1,$(subst -, ,$*)) GOARCH=$(word 2,$(subst -, ,$*)) $(BUILD_CMD) -o dist/backup-$* $(PACKAGE)

checksums:
@for file in dist/*; do \
if [ "$${file##*.}" != "sha256" ]; then \
sha256sum "$$file" > "$$file.sha256"; \
fi; \
done

release: release-linux-amd64 release-darwin-amd64 release-windows-amd64 checksums
release: release-linux-amd64 release-darwin-amd64 release-windows-amd64
@echo
@echo "Binaries with sizes and checksums:"
@echo "Binaries with sizes:"
@for file in dist/*; do \
if [ -f "$$file" ] && [ "$${file##*.}" != "sha256" ]; then \
if [ -f "$$file" ]; then \
size=$$(stat --printf="%s" "$$file"); \
checksum=$$(cat "$$file.sha256" | awk '{print $$1}'); \
printf "%-40s %-15s %-64s\n" "$$file" "Size: $$size bytes" "Checksum: $$checksum"; \
printf "%-40s Size: %s bytes\n" "$$file" "$$size"; \
fi; \
done

Expand Down
Loading