diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 39da28e..3091aaf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: git submodule update --init --recursive go.mk + - run: make go.mk - uses: ./go.mk/.github/actions/setup - uses: ./go.mk/.github/actions/pre-check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f41487e..1c1737e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 62cb519..b1fa281 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +/go.mk dist/ bin/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 31cdf10..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "go.mk"] - path = go.mk - url = https://github.com/exoscale/go.mk.git diff --git a/Makefile b/Makefile index 1eac53a..09290fa 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,35 @@ +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} + +go.mk/init.mk: include go.mk/init.mk +go.mk/public.mk: include go.mk/public.mk PACKAGE := github.com/exoscale/vault-plugin-auth-exoscale