feat: upstream version as main version (#31)

This commit is contained in:
Jingchao 2023-10-07 22:43:52 +08:00 committed by GitHub
parent b35a2c3932
commit 310944b76d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 10 deletions

View File

@ -11,7 +11,7 @@
# #
# The makefile is also responsible to populate project version information. # The makefile is also responsible to populate project version information.
#
# Tweak the variables based on your project. # Tweak the variables based on your project.
# #
SHELL := /bin/bash SHELL := /bin/bash
@ -40,11 +40,9 @@ COMMIT := $(COMMIT)$(shell git diff-files --quiet || echo '-dirty')
COMMIT := $(if $(COMMIT),$(COMMIT),"Unknown") COMMIT := $(if $(COMMIT),$(COMMIT),"Unknown")
# Current version of the project. # Current version of the project.
MAJOR_VERSION = 0 UPSTREAM_VERSION = $(shell cat UPSTREAM_VERSION | grep -E '^excalidraw:' | cut -d: -f2 | tr -d '[:space:]')
MINOR_VERSION = 1
PATCH_VERSION = 0
BUILD_VERSION = $(COMMIT) BUILD_VERSION = $(COMMIT)
VERSION ?= v$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)-$(BUILD_VERSION) VERSION ?= $(UPSTREAM_VERSION)-$(BUILD_VERSION)
CHINA_MIRROR ?= false CHINA_MIRROR ?= false
@ -98,12 +96,11 @@ update-docker-compose-version: ## Update images version for docker-compose
@for target in $(TARGETS); do \ @for target in $(TARGETS); do \
for registry in $(REGISTRIES); do \ for registry in $(REGISTRIES); do \
image=$${registry}$(IMAGE_PREFIX)$${target}$(IMAGE_SUFFIX); \ image=$${registry}$(IMAGE_PREFIX)$${target}$(IMAGE_SUFFIX); \
$(SED) -i -E "s#image: $${image}:[^ ]+#image: $${image}:$(VERSION)#g" docker-compose.yaml; \ version=$$(cat UPSTREAM_VERSION | grep -E "^$${target}:" | cut -d: -f2 | tr -d '[:space:]')-$(COMMIT); \
$(SED) -i -E "s#image: $${image}:[^ ]+#image: $${image}:$${version}#g" docker-compose.yaml; \
done; \ done; \
done done
.PHONY: bump-version .PHONY: bump-version
previousVersion=$(shell head -n 1 ./VERSION)
bump-version: ensure-git-clean update-docker-compose-version ## Bump images version for docker-compose bump-version: ensure-git-clean update-docker-compose-version ## Bump images version for docker-compose
echo $(VERSION) > ./VERSION
@echo "PLEASE using 'git commit -a' to commit image version changes" @echo "PLEASE using 'git commit -a' to commit image version changes"

View File

@ -39,6 +39,8 @@ open "http://localhost" # open browser, and you can using the Team work function
Bump version: Bump version:
excalidraw-collaboration always follow the excalidraw version, so you can only bump the appendix version.
``` ```
# make sure all changes are commited # make sure all changes are commited
make images # build new image without dirty make images # build new image without dirty

3
UPSTREAM_VERSION Normal file
View File

@ -0,0 +1,3 @@
excalidraw:v0.15.0
excalidraw-room:c0bf0ba
excalidraw-storage-backend:e321930

View File

@ -1 +0,0 @@
v0.1.0-3331458

View File

@ -17,4 +17,4 @@ services:
room: room:
image: excalidraw-room:v0.1.0-94d3682 image: excalidraw-room:v0.1.0-94d3682
ports: ports:
- 8082:80 - 8082:80