Skip to content

Commit

Permalink
Update workflow to generate website content
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Leon <leonde@vmware.com>
  • Loading branch information
cari-lynn committed Jul 13, 2021
1 parent ce83de4 commit 0daec89
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
with:
go-version: 1.16.0

- name: generate website/generate.go
if: startsWith(github.ref, 'refs/tags/')
run: |
./hack/build-binaries.sh "$VERSION"
- name: Run GoReleaser
# GoReleaser v2.5.0
uses: goreleaser/goreleaser-action@5e15885530fb01d81d1f24e8a6f54ebbd0fed7eb
Expand Down Expand Up @@ -92,7 +97,7 @@ jobs:
set -e -x
VERSION=`echo ${{ github.ref }} | grep -Eo '[0-9].*'`
./hack/build-binaries.sh "$VERSION" > ./go-checksums
./hack/build-binaries.sh "$VERSION"
cat ./go-checksums
diff ./go-checksums <(cat <<EOF
${{steps.get-checksums-from-draft-release.outputs.result}}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*main
.DS_Store
.idea
go-checksums
4 changes: 3 additions & 1 deletion hack/build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ go mod tidy
export CGO_ENABLED=0
LDFLAGS="-X github.com/k14s/ytt/pkg/version.Version=$VERSION -buildid="

./hack/build.sh $VERSION # Used to generate website/generated.go used by ytt website

GOOS=darwin GOARCH=amd64 go build -ldflags="$LDFLAGS" -trimpath -o ytt-darwin-amd64 ./cmd/ytt
GOOS=darwin GOARCH=arm64 go build -ldflags="$LDFLAGS" -trimpath -o ytt-darwin-arm64 ./cmd/ytt
GOOS=linux GOARCH=amd64 go build -ldflags="$LDFLAGS" -trimpath -o ytt-linux-amd64 ./cmd/ytt
GOOS=linux GOARCH=arm64 go build -ldflags="$LDFLAGS" -trimpath -o ytt-linux-arm64 ./cmd/ytt
GOOS=windows GOARCH=amd64 go build -ldflags="$LDFLAGS" -trimpath -o ytt-windows-amd64.exe ./cmd/ytt

shasum -a 256 ./ytt-darwin-amd64 ./ytt-darwin-arm64 ./ytt-linux-amd64 ./ytt-linux-arm64 ./ytt-windows-amd64.exe
shasum -a 256 ./ytt-darwin-amd64 ./ytt-darwin-arm64 ./ytt-linux-amd64 ./ytt-linux-arm64 ./ytt-windows-amd64.exe > ./go-checksums

0 comments on commit 0daec89

Please sign in to comment.