Skip to content

Commit

Permalink
go.mk: remove submodule and initialize through make
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp committed Feb 23, 2024
1 parent bfdaec1 commit 89dea1d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
go-version: '^1.18'
- name: Lint code
run: |
git submodule update --init --recursive go.mk
make go.mk
PATH=$(go env GOPATH)/bin:$PATH make lint
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
fetch-depth: 0

- run: git submodule update --init --recursive go.mk
- run: make go.mk
shell: bash

- name: Import GPG key
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ _test
dist
release
bin
/go.mk
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
GO_MK_REF := v1.0.0

# make go.mk a dependency for all targets
.EXTRA_PREREQS = go.mk

ifndef MAKE_RESTARTS
# This section will be processed the first time that make reads this file.

# This causes make to re-read the Makefile and all included
# makefiles after go.mk has been cloned.
Makefile:
@touch Makefile
endif

.PHONY: go.mk
.ONESHELL:
go.mk:
@if [ ! -d "go.mk" ]; then
git clone https://github.com/exoscale/go.mk.git
fi
@cd go.mk
@if ! git show-ref --quiet --verify "refs/heads/${GO_MK_REF}"; then
git fetch
fi
@if ! git show-ref --quiet --verify "refs/tags/${GO_MK_REF}"; then
git fetch --tags
fi
git checkout --quiet ${GO_MK_REF}

PROJECT_URL = https://github.com/exoscale/cert-manager-webhook-exoscale
go.mk/init.mk:
include go.mk/init.mk
go.mk/public.mk:
include go.mk/public.mk

GO ?= $(shell which go)
Expand Down

0 comments on commit 89dea1d

Please sign in to comment.