Add config for building/releasing binaries for other OSs

This commit is contained in:
David Dworken 2022-04-17 11:44:57 -07:00
parent cf54d4b416
commit 4036a4594b
6 changed files with 50 additions and 5 deletions

View File

@ -17,6 +17,7 @@ jobs:
with:
go-version: 1.17
- name: Go test
if: !startsWith(github.event.head_commit.message, 'Release')
run: make test
- name: Build docker contains
run: make build-api build-static

View File

@ -0,0 +1,12 @@
version: 1
flags:
- -trimpath
goos: darwin
goarch: amd64
binary: hishtory-{{ .OS }}-{{ .Arch }}
ldflags:
- '{{ .Env.VERSION_LDFLAGS }}'

View File

@ -0,0 +1,12 @@
version: 1
flags:
- -trimpath
goos: darwin
goarch: arm
binary: hishtory-{{ .OS }}-{{ .Arch }}
ldflags:
- '{{ .Env.VERSION_LDFLAGS }}'

View File

@ -9,12 +9,32 @@ acttest:
act push -j test
release:
# Bump the version
expr `cat VERSION` + 1 > VERSION
git add VERSION
git commit -m "Bump hishtory version to v0.`cat VERSION`"
git tag v0.`cat VERSION`
git push
git push --tags
git commit -m "Release: start releasing v0.`cat VERSION`" --no-verify
# Release linux-amd64
cp .slsa-goreleaser-linux-amd64.yml .slsa-goreleaser.yml
git add .slsa-goreleaser.yml
git commit -m "Release linux-amd64 v0.`cat VERSION`" --no-verify
git tag v0.`cat VERSION`-linux-amd64
# Release darwin-amd64
cp .slsa-goreleaser-darwin-amd64.yml .slsa-goreleaser.yml
git add .slsa-goreleaser.yml
git commit -m "Release darwin-amd64 v0.`cat VERSION`" --no-verify
git tag v0.`cat VERSION`-darwin-amd64
# Release darwin-arm64
cp .slsa-goreleaser-darwin-arm64.yml .slsa-goreleaser.yml
git add .slsa-goreleaser.yml
git commit -m "Release darwin-arm64 v0.`cat VERSION`" --no-verify
git tag v0.`cat VERSION`-darwin-arm64
# Clean up by removing .slsa-goreleaser.yml
rm .slsa-goreleaser.yml
git add .slsa-goreleaser.yml
git commit -m "Release: finish releasing v0.`cat VERSION`" --no-verify
# Push to trigger the releases
#git push
#git push --tags
build-static:
docker build -t gcr.io/dworken-k8s/hishtory-static -f backend/web/caddy/Dockerfile .

View File

@ -1 +1 @@
30
31