Skip to content

Commit

Permalink
go.mk: use as a plain repo instead of a submodule (#575)
Browse files Browse the repository at this point in the history
We remove the `go.mk` as a submodule and ensure that it is automatically
cloned and kept up to date with make.
  • Loading branch information
sauterp authored Feb 19, 2024
1 parent 9223f78 commit cea91f5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ runs:
with:
fetch-depth: 0

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

- uses: ./go.mk/.github/actions/setup

- uses: ./go.mk/.github/actions/pre-check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.git
/go.mk
dist
release
exo
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

### Improvements
- go.mk: use as a plain repo instead of a submodule #575

## 1.76.0

### Bug Fixes
Expand Down
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
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

# All files included from go.mk need an associated target or make will error
# before go.mk can be cloned.
go.mk/init.mk:
include go.mk/init.mk
go.mk/public.mk:
include go.mk/public.mk

.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/cli
GO_BIN_OUTPUT_NAME := exo
OAS_FILE := public-api.json
Expand Down
1 change: 0 additions & 1 deletion go.mk
Submodule go.mk deleted from 314a75

0 comments on commit cea91f5

Please sign in to comment.