Skip to content

Commit e248067

Browse files
authored
Merge pull request #3 from operatorstack/codex/content-control-plane
Separate Boatstack workflow control plane
2 parents 9fd010c + 24218de commit e248067

2 files changed

Lines changed: 129 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated from operatorstack/intelligence-flow.
1+
# Boatstack-owned control plane.
22
name: Verify Boatstack distribution
33

44
on:
@@ -11,11 +11,59 @@ permissions:
1111

1212
jobs:
1313
test:
14-
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
runs-on: ${{ matrix.os }}
1519
steps:
1620
- uses: actions/checkout@v4
21+
- name: Detect projected runtime
22+
id: runtime
23+
shell: bash
24+
run: |
25+
if [[ -f boatstack/go.mod ]]; then
26+
echo "go=true" >> "$GITHUB_OUTPUT"
27+
else
28+
echo "go=false" >> "$GITHUB_OUTPUT"
29+
fi
30+
- uses: actions/setup-go@v5
31+
if: steps.runtime.outputs.go == 'true'
32+
with:
33+
go-version-file: boatstack/go.mod
34+
cache-dependency-path: boatstack/go.mod
35+
- run: go test ./...
36+
if: steps.runtime.outputs.go == 'true'
37+
working-directory: boatstack
38+
- run: go build ./cmd/boatstack-helper
39+
if: steps.runtime.outputs.go == 'true'
40+
working-directory: boatstack
1741
- uses: actions/setup-python@v5
42+
if: steps.runtime.outputs.go != 'true'
1843
with:
1944
python-version: "3.11"
20-
- run: python3 -m unittest discover -s tests -v
21-
- run: python3 -m compileall -q boatstack
45+
- name: Verify legacy projection during migration
46+
if: steps.runtime.outputs.go != 'true'
47+
env:
48+
PYTHONUTF8: "1"
49+
run: python3 -m unittest discover -s tests -v
50+
- name: Compile legacy projection during migration
51+
if: steps.runtime.outputs.go != 'true'
52+
env:
53+
PYTHONUTF8: "1"
54+
run: python3 -m compileall -q boatstack
55+
- name: Validate Bash installer
56+
if: steps.runtime.outputs.go == 'true' && runner.os != 'Windows'
57+
shell: bash
58+
run: bash -n install.sh
59+
- name: Validate PowerShell installer
60+
if: steps.runtime.outputs.go == 'true' && runner.os == 'Windows'
61+
shell: pwsh
62+
run: |
63+
$tokens = $null
64+
$errors = $null
65+
[System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path install.ps1), [ref]$tokens, [ref]$errors) > $null
66+
if ($errors.Count -gt 0) {
67+
$errors | ForEach-Object { Write-Error $_ }
68+
exit 1
69+
}

.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)