Skip to content

Commit e3abd40

Browse files
authored
feat: remove the usage of git submodules (#14)
1 parent 5d11d83 commit e3abd40

File tree

7 files changed

+70
-32
lines changed

7 files changed

+70
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ jobs:
1717
with:
1818
submodules: recursive
1919

20+
- name: Extract repository name
21+
id: repo
22+
run: |
23+
echo "repo_name=$(basename "$GITHUB_REPOSITORY")" >> $GITHUB_ENV
24+
2025
- name: Generate Build Version
21-
uses: hashicorp/actions-generate-metadata@main
26+
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
2227
id: execute
2328
with:
2429
repositoryOwner: ${{ github.repository_owner }}
2530
repository: ${{ github.repository }}
2631
version: cat VERSION
27-
product: gateway-extension
32+
product: ${{ env.repo_name }}
2833
metadataFileName: ${{ github.workspace }}/build_version.json
2934

3035
- name: Print Build Version
@@ -36,10 +41,16 @@ jobs:
3641
with:
3742
go-version-file: go.mod
3843

44+
- name: Checkout build (taskfiles) repo
45+
run: |
46+
git clone https://github.com/openkcm/build.git ./hack/common
47+
3948
- name: Install Task
40-
uses: arduino/setup-task@v2
49+
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2.0.0
4150
with:
4251
version: 3.x
52+
env:
53+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
4354

4455
- name: task validate
4556
run: task validate --verbose

.github/workflows/publish.yaml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,35 @@ jobs:
3535
fetch-depth: 0
3636
submodules: recursive
3737

38+
- name: Extract repository name
39+
id: repo
40+
run: |
41+
echo "repo_name=$(basename "$GITHUB_REPOSITORY")" >> $GITHUB_ENV
42+
43+
- name: Generate Build Version
44+
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
45+
id: execute
46+
with:
47+
repositoryOwner: ${{ github.repository_owner }}
48+
repository: ${{ github.repository }}
49+
version: cat VERSION
50+
product: ${{ env.repo_name }}
51+
metadataFileName: ${{ github.workspace }}/build_version.json
52+
53+
- name: Print Build Version
54+
shell: bash
55+
run: cat ${{ github.workspace }}/build_version.json
56+
57+
- name: Checkout build (taskfiles) repo
58+
run: |
59+
git clone https://github.com/openkcm/build.git ./hack/common
60+
3861
- name: Install Task
3962
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2.0.0
4063
with:
4164
version: 3.x
65+
env:
66+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
4267

4368
- name: Read and validate VERSION
4469
id: version
@@ -84,20 +109,6 @@ jobs:
84109
with:
85110
go-version-file: go.mod
86111

87-
- name: Generate Build Version
88-
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
89-
id: execute
90-
with:
91-
repositoryOwner: ${{ github.repository_owner }}
92-
repository: ${{ github.repository }}
93-
version: cat VERSION
94-
product: gateway-extension
95-
metadataFileName: ${{ github.workspace }}/build_version.json
96-
97-
- name: Print Build Version
98-
shell: bash
99-
run: cat ${{ github.workspace }}/build_version.json
100-
101112
- name: Build and Push Images
102113
run: |
103114
task build:img:all --verbose

.github/workflows/release.yaml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,35 @@ jobs:
3232
fetch-depth: 0
3333
submodules: recursive
3434

35+
- name: Extract repository name
36+
id: repo
37+
run: |
38+
echo "repo_name=$(basename "$GITHUB_REPOSITORY")" >> $GITHUB_ENV
39+
40+
- name: Generate Build Version
41+
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
42+
id: execute
43+
with:
44+
repositoryOwner: ${{ github.repository_owner }}
45+
repository: ${{ github.repository }}
46+
version: cat VERSION
47+
product: ${{ env.repo_name }}
48+
metadataFileName: ${{ github.workspace }}/build_version.json
49+
50+
- name: Print Build Version
51+
shell: bash
52+
run: cat ${{ github.workspace }}/build_version.json
53+
54+
- name: Checkout build (taskfiles) repo
55+
run: |
56+
git clone https://github.com/openkcm/build.git ./hack/common
57+
3558
- name: Install Task
3659
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2.0.0
3760
with:
3861
version: 3.x
62+
env:
63+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
3964

4065
- name: Read and validate VERSION
4166
id: version
@@ -151,7 +176,7 @@ jobs:
151176
- name: Generate SBOM
152177
if: ${{ env.SKIP != 'true' }}
153178
run: |
154-
task cyclonedxgomod:mod-application --verbose
179+
task cyclonedxgomod:app --verbose
155180
156181
- name: Create GitHub release
157182
if: ${{ env.SKIP != 'true' }}
@@ -160,7 +185,7 @@ jobs:
160185
tag_name: ${{ env.version }}
161186
name: Release ${{ env.version }}
162187
body: ${{steps.github_release.outputs.changelog}}
163-
files: "sbom.json"
188+
files: "*sbom.json"
164189
draft: true
165190
prerelease: false
166191
env:
@@ -169,9 +194,8 @@ jobs:
169194
- name: Clean up SBOM files
170195
if: ${{ env.SKIP != 'true' }}
171196
run: |
172-
echo "Removing the following SBOM files:"
173-
rm -f sbom.json
174-
rm -rf bin/
197+
rm -f *sbom.json
198+
rm -rf hack
175199
176200
- name: Create pr for next version
177201
if: ${{ env.SKIP != 'true' }}

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ NAME := gateway-extension
33
IMGTAG ?= latest
44
IMG ?= localhost/$(NAME):${IMGTAG}
55

6-
hacks.dir = hack
7-
8-
$(tools.bindir)/%: $(tools.srcdir)/%/pin.go $(tools.srcdir)/%/go.mod
9-
cd $(<D) && GOOS= GOARCH= go build -o $(abspath $@) $$(sed -En 's,^import _ "(.*)".*,\1,p' pin.go)
10-
6+
tools.dir = tools
117

128
.PHONY: install-controller-gen
139
install-controller-gen:
@@ -16,7 +12,7 @@ install-controller-gen:
1612
.PHONY: generate-crds
1713
generate-crds:
1814
controller-gen crd:allowDangerousTypes=true,generateEmbeddedObjectMeta=true \
19-
object:headerFile="$(hacks.dir)/boilerplate.generatego.txt",year=2025 paths="{./...}" \
15+
object:headerFile="$(tools.dir)/boilerplate.generatego.txt",year=2025 paths="{./...}" \
2016
output:crd:artifacts:config=charts/gateway-extension/crds; \
2117
goimports -w .
2218

hack/common

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)