Skip to content

Commit

Permalink
go.mk: remove submodule and initialize through make (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp authored Mar 1, 2024
1 parent d7f0025 commit dcca7fb
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
@@ -1,3 +1,4 @@
/go.mk
dist/
bin/
/release
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,12 +1,43 @@
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}

PACKAGE := github.com/exoscale/vault-plugin-secrets-exoscale
PROJECT_URL := https://$(PACKAGE)
GO_MAIN_PKG_PATH := ./cmd/vault-plugin-secrets-exoscale


go.mk/init.mk:
include go.mk/init.mk

GO_LD_FLAGS := -ldflags "-s -w -X $(PACKAGE)/version.Version=${VERSION} -X $(PACKAGE)/version.Commit=${GIT_REVISION}"

go.mk/public.mk:
include go.mk/public.mk

ifeq ($(VERSION), dev)
Expand Down
1 change: 0 additions & 1 deletion go.mk
Submodule go.mk deleted from c5d585

0 comments on commit dcca7fb

Please sign in to comment.