Skip to content

Commit ea6e453

Browse files
committed
fix: ensure make automatically pulls the latest version
1 parent 8f02ab4 commit ea6e453

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

libs/crossplane-provider-upjet-aws/Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
22
TMP:=$(shell mktemp -d)
3-
AWS_VERSION?=$(shell cat version)
43

5-
default: crds.libsonnet
4+
all: update-version crds.libsonnet
5+
6+
.PHONY: update-version
7+
update-version:
8+
@NEW_VERSION=$$(gh release view --repo crossplane-contrib/provider-upjet-aws --json tagName --jq '.tagName'); \
9+
if [ ! -f version ] || [ "$$(cat version)" != "$$NEW_VERSION" ]; then \
10+
echo "$$NEW_VERSION" > version; \
11+
echo "Updated version to $$NEW_VERSION"; \
12+
else \
13+
echo "Version unchanged: $$NEW_VERSION"; \
14+
fi
615

716
crds.libsonnet: version
817
cd $(TMP) && \
918
jb init && \
10-
jb install github.com/crossplane-contrib/provider-upjet-aws/package/crds@$(AWS_VERSION) && \
19+
jb install github.com/crossplane-contrib/provider-upjet-aws/package/crds@$(shell cat version) && \
1120
echo '[' > $(ROOT_DIR)/crds.libsonnet && \
1221
cd vendor/github.com/crossplane-contrib/provider-upjet-aws/package/crds && \
1322
find . -type f -printf "%f\n" | sort | xargs -I {} echo "'{}'," >> $(ROOT_DIR)/crds.libsonnet && \

libs/crossplane-provider-upjet-aws/config.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local config = import 'jsonnet/config.jsonnet';
22

3-
// Bump version in `version` file and run `make` to regenerate `crds.libsonnet`
3+
// Run `make` to get the latest version and regenerate `crds.libsonnet`
44
local version = importstr './version';
55
local crds = import './crds.libsonnet';
66

0 commit comments

Comments
 (0)