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 733630e commit 309d33c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v3
- run: git submodule update --init --recursive go.mk
- run: make go.mk
- uses: ./go.mk/.github/actions/setup
- name: Build Docker image
run: make docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integ-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
fetch-depth: 0

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

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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
- name: Build Docker image
run: make docker
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

# Dependency directories (remove the comment below to include it)
# vendor/
/go.mk

# Go workspace file
go.work
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

34 changes: 32 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,42 @@ EXTRA_ARGS := -parallel 3 -count=1 -failfast
# Dependencies

# Requires: https://github.com/exoscale/go.mk
# - install: git submodule update --init --recursive go.mk
# - update: git submodule update --remote
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

## Targets

# Docker
go.mk/init.mk:
include Makefile.docker
1 change: 1 addition & 0 deletions Makefile.docker
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
go.mk/version.mk:
include go.mk/version.mk

.PHONY: docker
Expand Down

0 comments on commit 309d33c

Please sign in to comment.