Skip to content

Commit 0df5bb1

Browse files
committed
feat(release): ship web+mcp ports and image metadata for deployments
Enable building and packaging the Angular UI into the container, expose web/MCP ports consistently across kustomize/helm, and log build version info to aid traceability. Adds snapshot release targets and updates default image/flags for dev and chart usage. Signed-off-by: David Sabatie <david.sabatie@notrenet.com>
1 parent 5f2aecd commit 0df5bb1

23 files changed

Lines changed: 475 additions & 28 deletions

.dockerignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@
33
**
44

55
# Re-include Go source files (but not *_test.go)
6-
!**/*.go
6+
!cmd/**
7+
!api/**
8+
!internal/**
79
**/*_test.go
810

911
# Re-include Go module files
1012
!go.mod
1113
!go.sum
14+
15+
# Re-include web UI source files
16+
!web/package.json
17+
!web/package-lock.json
18+
!web/angular.json
19+
!web/tsconfig.json
20+
!web/tsconfig.app.json
21+
!web/src/**

.github/workflows/dev-build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Dev Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
dev-build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "22"
30+
cache: "npm"
31+
cache-dependency-path: web/package-lock.json
32+
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Login to GHCR
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Run GoReleaser (snapshot)
47+
uses: goreleaser/goreleaser-action@v6
48+
with:
49+
version: latest
50+
args: release -f .goreleaser-dev.yaml --snapshot --clean
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Push Docker images
55+
run: |
56+
docker images --format '{{.Repository}}:{{.Tag}}' | grep 'ghcr.io/golgoth31/sreportal/dev' | while read image; do
57+
docker push "$image"
58+
done

.github/workflows/helm-release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Helm Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
helm-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Helm
20+
uses: azure/setup-helm@v4
21+
22+
- name: Login to GHCR
23+
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
24+
25+
- name: Extract version from tag
26+
id: version
27+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
28+
29+
- name: Update Chart.yaml version
30+
run: |
31+
sed -i "s/^version:.*/version: ${{ steps.version.outputs.version }}/" helm/Chart.yaml
32+
sed -i "s/^appVersion:.*/appVersion: \"${{ steps.version.outputs.version }}\"/" helm/Chart.yaml
33+
34+
- name: Package Helm chart
35+
run: helm package helm/
36+
37+
- name: Push Helm chart to GHCR
38+
run: helm push sreportal-${{ steps.version.outputs.version }}.tgz oci://ghcr.io/golgoth31/sreportal/charts
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Run Release Please
17+
uses: googleapis/release-please-action@v4
18+
with:
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "22"
30+
cache: "npm"
31+
cache-dependency-path: web/package-lock.json
32+
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Login to GHCR
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Run GoReleaser
47+
uses: goreleaser/goreleaser-action@v6
48+
with:
49+
version: latest
50+
args: release --clean
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ tmp
3232

3333
# Hugo build output
3434
docs/public/
35-
docs/.hugo_build.lock
35+
docs/.hugo_build.lock
36+
37+
/node_modules

.goreleaser-dev.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
- npm ci --prefix web
7+
- npm run build --prefix web
8+
9+
builds:
10+
- id: manager
11+
main: ./cmd
12+
binary: manager
13+
env:
14+
- CGO_ENABLED=0
15+
goos:
16+
- linux
17+
goarch:
18+
- amd64
19+
- arm64
20+
ldflags:
21+
- -s -w
22+
- -X github.com/golgoth31/sreportal/internal/version.Version={{ .Version }}
23+
- -X github.com/golgoth31/sreportal/internal/version.Commit={{ .Commit }}
24+
- -X github.com/golgoth31/sreportal/internal/version.Date={{ .Date }}
25+
26+
dockers_v2:
27+
- id: sreportal-dev
28+
ids:
29+
- manager
30+
images:
31+
- "ghcr.io/golgoth31/sreportal/dev"
32+
tags:
33+
- "{{ .ShortCommit }}"
34+
- "latest"
35+
dockerfile: Dockerfile.goreleaser
36+
platforms:
37+
- linux/amd64
38+
- linux/arm64
39+
extra_files:
40+
- web/dist/web/browser
41+
42+
archives:
43+
- id: default
44+
formats:
45+
- tar.gz
46+
name_template: >-
47+
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
48+
49+
changelog:
50+
disable: true
51+
52+
release:
53+
disable: true

.goreleaser.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
- npm ci --prefix web
7+
- npm run build --prefix web
8+
9+
builds:
10+
- id: manager
11+
main: ./cmd
12+
binary: manager
13+
env:
14+
- CGO_ENABLED=0
15+
goos:
16+
- linux
17+
goarch:
18+
- amd64
19+
- arm64
20+
ldflags:
21+
- -s -w
22+
- -X github.com/golgoth31/sreportal/internal/version.Version={{ .Version }}
23+
- -X github.com/golgoth31/sreportal/internal/version.Commit={{ .Commit }}
24+
- -X github.com/golgoth31/sreportal/internal/version.Date={{ .Date }}
25+
26+
dockers_v2:
27+
- id: sreportal
28+
ids:
29+
- manager
30+
images:
31+
- "ghcr.io/golgoth31/sreportal"
32+
tags:
33+
- "{{ .Tag }}"
34+
- "v{{ .Major }}"
35+
- "v{{ .Major }}.{{ .Minor }}"
36+
- "latest"
37+
dockerfile: Dockerfile.goreleaser
38+
platforms:
39+
- linux/amd64
40+
- linux/arm64
41+
extra_files:
42+
- web/dist/web/browser
43+
44+
archives:
45+
- id: default
46+
formats:
47+
- tar.gz
48+
name_template: >-
49+
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
50+
51+
changelog:
52+
sort: asc
53+
filters:
54+
exclude:
55+
- "^docs:"
56+
- "^test:"
57+
- "^ci:"
58+
- "^chore:"
59+
60+
release:
61+
github:
62+
owner: golgoth31
63+
name: sreportal
64+
draft: false
65+
prerelease: auto

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"sreportal": {
4+
"type": "sse",
5+
"url": "http://localhost:8090/sse"
6+
}
7+
}
8+
}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

0 commit comments

Comments
 (0)