Skip to content

Commit d1d71f9

Browse files
committed
Add Boatstack helper release workflow
1 parent 4388e83 commit d1d71f9

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Boatstack-owned control plane.
2+
name: Release Boatstack helper
3+
4+
on:
5+
push:
6+
tags: ["v*"]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- goos: linux
20+
goarch: amd64
21+
asset: boatstack-helper_linux_amd64
22+
- goos: linux
23+
goarch: arm64
24+
asset: boatstack-helper_linux_arm64
25+
- goos: darwin
26+
goarch: amd64
27+
asset: boatstack-helper_darwin_amd64
28+
- goos: darwin
29+
goarch: arm64
30+
asset: boatstack-helper_darwin_arm64
31+
- goos: windows
32+
goarch: amd64
33+
asset: boatstack-helper_windows_amd64.exe
34+
- goos: windows
35+
goarch: arm64
36+
asset: boatstack-helper_windows_arm64.exe
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-go@v5
40+
with:
41+
go-version-file: boatstack/go.mod
42+
cache-dependency-path: boatstack/go.mod
43+
- name: Build native helper
44+
shell: bash
45+
env:
46+
GOOS: ${{ matrix.goos }}
47+
GOARCH: ${{ matrix.goarch }}
48+
CGO_ENABLED: "0"
49+
ASSET: ${{ matrix.asset }}
50+
VERSION: ${{ github.ref_name }}
51+
run: |
52+
source_commit="$(jq -r '.source.commit' UPSTREAM.json)"
53+
mkdir -p dist
54+
cd boatstack
55+
go build -trimpath \
56+
-ldflags "-s -w -X github.com/operatorstack/boatstack/boatstack.Version=$VERSION -X github.com/operatorstack/boatstack/boatstack.SourceCommit=$source_commit -X github.com/operatorstack/boatstack/boatstack.ChecksumsSHA256=per-asset-sidecar" \
57+
-o "../dist/$ASSET" ./cmd/boatstack-helper
58+
cd ../dist
59+
sha256sum "$ASSET" > "$ASSET.sha256"
60+
- uses: actions/upload-artifact@v4
61+
with:
62+
name: ${{ matrix.asset }}
63+
path: dist/${{ matrix.asset }}*
64+
65+
release:
66+
if: startsWith(github.ref, 'refs/tags/')
67+
needs: build
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/download-artifact@v4
71+
with:
72+
path: dist
73+
merge-multiple: true
74+
- name: Publish release assets
75+
env:
76+
GH_TOKEN: ${{ github.token }}
77+
run: gh release create "${GITHUB_REF_NAME}" dist/* --repo "${GITHUB_REPOSITORY}" --generate-notes --verify-tag

0 commit comments

Comments
 (0)