Skip to content

Commit c02d53e

Browse files
committed
Install hugo manually
Using Bingo, we're installing Hugo from sources. The extended version of Hugo takes too long to compile and it's causing issues in GitHub Actions.
1 parent e4883b1 commit c02d53e

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

.bingo/Variables.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ $(GORELEASER): $(BINGO_DIR)/goreleaser.mod
3535
@echo "(re)installing $(GOBIN)/goreleaser-v0.169.0"
3636
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v0.169.0 "github.com/goreleaser/goreleaser"
3737

38-
HUGO := $(GOBIN)/hugo-v0.88.1
39-
$(HUGO): $(BINGO_DIR)/hugo.mod
40-
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
41-
@echo "(re)installing $(GOBIN)/hugo-v0.88.1"
42-
@cd $(BINGO_DIR) && CGO_ENABLED=1 $(GO) build -tags=extended -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.88.1 "github.com/gohugoio/hugo"
43-
4438
MOCKGEN := $(GOBIN)/mockgen-v1.6.0
4539
$(MOCKGEN): $(BINGO_DIR)/mockgen.mod
4640
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.

.bingo/hugo.mod

Lines changed: 0 additions & 5 deletions
This file was deleted.

.bingo/variables.env

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.42.1"
1414

1515
GORELEASER="${GOBIN}/goreleaser-v0.169.0"
1616

17-
HUGO="${GOBIN}/hugo-v0.88.1"
18-
1917
MOCKGEN="${GOBIN}/mockgen-v1.6.0"
2018

Makefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,27 @@ release-test-config:
4444
release-test:
4545
$(GORELEASER) --skip-publish
4646

47-
website:
48-
$(HUGO) serve --source=website/
47+
PROJECT := enduro
48+
UNAME_OS := $(shell uname -s)
49+
UNAME_ARCH := $(shell uname -m)
50+
CACHE_BASE := $(HOME)/.cache/$(PROJECT)
51+
CACHE := $(CACHE_BASE)/$(UNAME_OS)/$(UNAME_ARCH)
52+
CACHE_BIN := $(CACHE)/bin
53+
export PATH := $(abspath $(CACHE_BIN)):$(PATH)
54+
CACHE_VERSIONS := $(CACHE)/versions
55+
HUGO_VERSION := 0.88.1
56+
HUGO := $(CACHE_VERSIONS)/hugo/$(HUGO_VERSION)
57+
$(HUGO):
58+
@rm -f $(CACHE_BIN)/hugo
59+
@mkdir -p $(CACHE_BIN)
60+
curl -sSL "https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_extended_$(HUGO_VERSION)_Linux-64bit.tar.gz" | tar xz -C "$(CACHE_BIN)"
61+
chmod +x "$(CACHE_BIN)/hugo"
62+
@rm -rf $(dir $(HUGO))
63+
@mkdir -p $(dir $(HUGO))
64+
@touch $(HUGO)
65+
66+
website: $(HUGO)
67+
hugo serve --source=website/
4968

5069
ui:
5170
yarn --cwd ui install

0 commit comments

Comments
 (0)