Skip to content

feat: remove the usage of git submodules #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ jobs:
with:
submodules: recursive

- name: Extract repository name
id: repo
run: |
echo "repo_name=$(basename "$GITHUB_REPOSITORY")" >> $GITHUB_ENV

- name: Generate Build Version
uses: hashicorp/actions-generate-metadata@main
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
id: execute
with:
repositoryOwner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
version: cat VERSION
product: gateway-extension
product: ${{ env.repo_name }}
metadataFileName: ${{ github.workspace }}/build_version.json

- name: Print Build Version
Expand All @@ -36,10 +41,16 @@ jobs:
with:
go-version-file: go.mod

- name: Checkout build (taskfiles) repo
run: |
git clone https://github.com/openkcm/build.git ./hack/common

- name: Install Task
uses: arduino/setup-task@v2
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2.0.0
with:
version: 3.x
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

- name: task validate
run: task validate --verbose
Expand Down
39 changes: 25 additions & 14 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,35 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Extract repository name
id: repo
run: |
echo "repo_name=$(basename "$GITHUB_REPOSITORY")" >> $GITHUB_ENV

- name: Generate Build Version
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
id: execute
with:
repositoryOwner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
version: cat VERSION
product: ${{ env.repo_name }}
metadataFileName: ${{ github.workspace }}/build_version.json

- name: Print Build Version
shell: bash
run: cat ${{ github.workspace }}/build_version.json

- name: Checkout build (taskfiles) repo
run: |
git clone https://github.com/openkcm/build.git ./hack/common

- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2.0.0
with:
version: 3.x
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

- name: Read and validate VERSION
id: version
Expand Down Expand Up @@ -84,20 +109,6 @@ jobs:
with:
go-version-file: go.mod

- name: Generate Build Version
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
id: execute
with:
repositoryOwner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
version: cat VERSION
product: gateway-extension
metadataFileName: ${{ github.workspace }}/build_version.json

- name: Print Build Version
shell: bash
run: cat ${{ github.workspace }}/build_version.json

- name: Build and Push Images
run: |
task build:img:all --verbose
Expand Down
34 changes: 29 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,35 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Extract repository name
id: repo
run: |
echo "repo_name=$(basename "$GITHUB_REPOSITORY")" >> $GITHUB_ENV

- name: Generate Build Version
uses: hashicorp/actions-generate-metadata@f6f1ca9cededa05d841a58d171064faf3de8ec74 #main
id: execute
with:
repositoryOwner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
version: cat VERSION
product: ${{ env.repo_name }}
metadataFileName: ${{ github.workspace }}/build_version.json

- name: Print Build Version
shell: bash
run: cat ${{ github.workspace }}/build_version.json

- name: Checkout build (taskfiles) repo
run: |
git clone https://github.com/openkcm/build.git ./hack/common

- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2.0.0
with:
version: 3.x
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

- name: Read and validate VERSION
id: version
Expand Down Expand Up @@ -151,7 +176,7 @@ jobs:
- name: Generate SBOM
if: ${{ env.SKIP != 'true' }}
run: |
task cyclonedxgomod:mod-application --verbose
task cyclonedxgomod:app --verbose

- name: Create GitHub release
if: ${{ env.SKIP != 'true' }}
Expand All @@ -160,7 +185,7 @@ jobs:
tag_name: ${{ env.version }}
name: Release ${{ env.version }}
body: ${{steps.github_release.outputs.changelog}}
files: "sbom.json"
files: "*sbom.json"
draft: true
prerelease: false
env:
Expand All @@ -169,9 +194,8 @@ jobs:
- name: Clean up SBOM files
if: ${{ env.SKIP != 'true' }}
run: |
echo "Removing the following SBOM files:"
rm -f sbom.json
rm -rf bin/
rm -f *sbom.json
rm -rf hack

- name: Create pr for next version
if: ${{ env.SKIP != 'true' }}
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ NAME := gateway-extension
IMGTAG ?= latest
IMG ?= localhost/$(NAME):${IMGTAG}

hacks.dir = hack

$(tools.bindir)/%: $(tools.srcdir)/%/pin.go $(tools.srcdir)/%/go.mod
cd $(<D) && GOOS= GOARCH= go build -o $(abspath $@) $$(sed -En 's,^import _ "(.*)".*,\1,p' pin.go)

tools.dir = tools

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

Expand Down
1 change: 0 additions & 1 deletion hack/common
Submodule common deleted from 665b67
File renamed without changes.
Loading