Skip to content

Commit 48ea497

Browse files
emosbaughJGAntunes
andauthored
chore: include generated assets in repo (#2201)
* chore: include dist assets in repo * chore: include generated assets in repo * f * f * f * f * f * f * f * f * f * Update .nvmrc Co-authored-by: João Antunes <[email protected]> * f --------- Co-authored-by: João Antunes <[email protected]>
1 parent 0970637 commit 48ea497

File tree

12 files changed

+258
-29
lines changed

12 files changed

+258
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,48 @@ jobs:
112112
name: Check operator CRDs
113113
runs-on: ubuntu-latest
114114
steps:
115-
- name: Checkout
116-
uses: actions/checkout@v4
117-
- name: Make manifests
118-
env:
119-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120-
run: make -C operator manifests
121-
- name: Check CRDs
122-
run: |
123-
git diff --exit-code --name-only
124-
if [ $? -eq 0 ]; then
125-
echo "CRDs are up to date"
126-
else
127-
echo "CRDs are out of date"
128-
exit 1
129-
fi
115+
- name: Checkout
116+
uses: actions/checkout@v4
117+
- name: Setup go
118+
uses: actions/setup-go@v5
119+
with:
120+
go-version-file: go.mod
121+
cache-dependency-path: "**/*.sum"
122+
- name: Make manifests
123+
env:
124+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
run: make -C operator manifests
126+
- name: Check CRDs
127+
run: |
128+
git diff --exit-code --name-only
129+
if [ $? -eq 0 ]; then
130+
echo "CRDs are up to date"
131+
else
132+
echo "CRDs are out of date"
133+
exit 1
134+
fi
135+
136+
check-swagger-docs:
137+
name: Check swagger docs
138+
runs-on: ubuntu-latest
139+
steps:
140+
- name: Checkout
141+
uses: actions/checkout@v4
142+
- name: Setup go
143+
uses: actions/setup-go@v5
144+
with:
145+
go-version-file: go.mod
146+
cache-dependency-path: "**/*.sum"
147+
- name: Check swagger docs
148+
run: |
149+
make -C api swagger
150+
git diff --exit-code --name-only
151+
if [ $? -eq 0 ]; then
152+
echo "Swagger docs are up to date"
153+
else
154+
echo "Swagger docs are out of date"
155+
exit 1
156+
fi
130157
131158
buildtools:
132159
name: Build buildtools
@@ -174,6 +201,11 @@ jobs:
174201
go-version-file: go.mod
175202
cache-dependency-path: "**/*.sum"
176203

204+
- name: Setup node
205+
uses: actions/setup-node@v4
206+
with:
207+
node-version-file: ./web/.nvmrc
208+
177209
- uses: oras-project/setup-oras@v1
178210

179211
- uses: imjasonh/[email protected]
@@ -248,6 +280,11 @@ jobs:
248280
go-version-file: go.mod
249281
cache-dependency-path: "**/*.sum"
250282

283+
- name: Setup node
284+
uses: actions/setup-node@v4
285+
with:
286+
node-version-file: ./web/.nvmrc
287+
251288
- uses: oras-project/setup-oras@v1
252289

253290
- uses: imjasonh/[email protected]
@@ -357,6 +394,11 @@ jobs:
357394
go-version-file: go.mod
358395
cache-dependency-path: "**/*.sum"
359396

397+
- name: Setup node
398+
uses: actions/setup-node@v4
399+
with:
400+
node-version-file: ./web/.nvmrc
401+
360402
- uses: oras-project/setup-oras@v1
361403

362404
- uses: imjasonh/[email protected]
@@ -817,6 +859,7 @@ jobs:
817859
- dryrun-tests
818860
- check-images
819861
- check-operator-crds
862+
- check-swagger-docs
820863
if: always()
821864
steps:
822865
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
@@ -841,5 +884,8 @@ jobs:
841884
- name: fail if check-operator-crds job was not successful
842885
if: needs.check-operator-crds.result != 'success'
843886
run: exit 1
887+
- name: fail if check-swagger-docs job was not successful
888+
if: needs.check-swagger-docs.result != 'success'
889+
run: exit 1
844890
- name: succeed if everything else passed
845891
run: echo "Validation succeeded"

.github/workflows/release-prod.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ jobs:
148148
go-version-file: go.mod
149149
cache-dependency-path: "**/*.sum"
150150

151+
- name: Setup node
152+
uses: actions/setup-node@v4
153+
with:
154+
node-version-file: ./web/.nvmrc
155+
151156
- uses: oras-project/setup-oras@v1
152157

153158
- uses: imjasonh/[email protected]
@@ -168,6 +173,12 @@ jobs:
168173
run: |
169174
./scripts/ci-update-operator-metadata.sh
170175
176+
- name: Build web
177+
working-directory: ./web
178+
run: |
179+
npm ci
180+
npm run build
181+
171182
- name: Build linux-amd64
172183
run: |
173184
mkdir -p build

api/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SHELL := /bin/bash
22

33
.PHONY: swagger
4-
swagger:
4+
swagger: swag
55
swag fmt -g api.go
66
swag init --v3.1 -g api.go
77

scripts/ci-build-bin.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ function deps() {
3636
make buildtools
3737
}
3838

39+
function web() {
40+
local install_cmd="npm i"
41+
if [ "${CI:-}" = "true" ]; then
42+
install_cmd="npm ci"
43+
fi
44+
(set -x; cd web && \
45+
$install_cmd && \
46+
npm run build)
47+
}
48+
3949
function binary() {
4050
local local_artifact_mirror_image k0s_binary_url="" kots_binary_url="" operator_binary_url=""
4151

@@ -50,7 +60,7 @@ function binary() {
5060
fi
5161
local_artifact_mirror_image="proxy.replicated.com/anonymous/$(cat local-artifact-mirror/build/image)"
5262

53-
make embedded-cluster-linux-$ARCH \
63+
make "embedded-cluster-linux-$ARCH" \
5464
K0S_VERSION="$K0S_VERSION" \
5565
K0S_GO_VERSION="$K0S_GO_VERSION" \
5666
VERSION="$EC_VERSION" \
@@ -101,7 +111,7 @@ function archive() {
101111

102112
function metadata() {
103113
mkdir -p build
104-
docker run --rm --platform linux/$ARCH -v "$(pwd)/output/bin:/wrk" -w /wrk debian:bookworm-slim \
114+
docker run --rm --platform "linux/$ARCH" -v "$(pwd)/output/bin:/wrk" -w /wrk debian:bookworm-slim \
105115
./embedded-cluster version metadata > "build/metadata.json"
106116
log "created build/metadata.json"
107117
}
@@ -110,6 +120,7 @@ function main() {
110120
init_vars
111121
deps
112122
update_operator_metadata
123+
web
113124
binary
114125
archive
115126
metadata

scripts/ci-embed-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function create_release_archive() {
9292
helm package -u e2e/helm-charts/$CHART -d output/tmp/release
9393

9494
# Get the packaged chart filename
95-
CHART_FILENAME=$(ls output/tmp/release/$CHART-*.tgz | head -1)
95+
CHART_FILENAME=$(find output/tmp/release -name "$CHART-*.tgz" -type f | head -1)
9696
if [ -n "$CHART_FILENAME" ]; then
9797
echo "Created Helm chart package: $CHART_FILENAME"
9898
else

scripts/ci-release-app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function create_release() {
8888
helm package -u e2e/helm-charts/$CHART -d output/tmp/release
8989

9090
# Get the packaged chart filename
91-
CHART_FILENAME=$(ls output/tmp/release/$CHART-*.tgz | head -1)
91+
CHART_FILENAME=$(find output/tmp/release -name "$CHART-*.tgz" -type f | head -1)
9292
if [ -n "$CHART_FILENAME" ]; then
9393
echo "Created Helm chart package: $CHART_FILENAME"
9494
else

scripts/ci-upload-binaries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function kotsbin() {
122122
fi
123123
elif [ -n "${kots_file_override}" ]; then
124124
echo "KOTS_BINARY_FILE_OVERRIDE is set to '${kots_file_override}', using that source"
125-
tar -czvf "build/kots_linux_${ARCH}.tar.gz" -C $(dirname "${kots_file_override}") $(basename "${kots_file_override}")
125+
tar -czvf "build/kots_linux_${ARCH}.tar.gz" -C "$(dirname "${kots_file_override}")" "$(basename "${kots_file_override}")"
126126
else
127127
echo "extracting kots binary from kotsadm image"
128128
crane export "kotsadm/kotsadm:${kots_version}" --platform "linux/${ARCH}" - | tar -Oxf - kots > build/kots

web/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22

web/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)