Skip to content

Commit 2be97e8

Browse files
authored
[#137] Use VERSION as a release artefact (#138)
1 parent fd5064e commit 2be97e8

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ jobs:
2929
3030
- name: Build distribution packages
3131
run: |
32-
make package
32+
VERSION="${GITHUB_REF_NAME#v}"
33+
make package VERSION="${VERSION}"
3334
3435
- name: Stage release artefacts
3536
id: stage
3637
run: |
37-
VERSION=$(cat src/VERSION)
38+
VERSION="${GITHUB_REF_NAME#v}"
3839
mkdir -p artefacts
3940
cp dist/bmakelib-${VERSION}-portable.tar.gz \
4041
dist/*.rpm \

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SHELL := /usr/bin/env -S bash -o pipefail
2121
export ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2222
URL := https://github.com/bahmanm/bmakelib
2323
NAME := bmakelib
24-
VERSION = $(file < $(ROOT)src/VERSION)
24+
VERSION ?= development
2525
PKG_VERSION = $(subst -,~,$(VERSION))
2626
DEB_MAINTAINER_NAME ?= $(or $(shell git config user.name 2>/dev/null),Bahman Movaqar)
2727
DEB_MAINTAINER_EMAIL ?= $(or $(shell git config user.email 2>/dev/null),Bahman@BahmanM.com)
@@ -220,12 +220,11 @@ build : $(BUILD)
220220
build : test
221221
build : doc-update
222222
build :
223-
mkdir -p $(BUILD)include \
224-
&& find src -type f \( -name '*.mk' -or -name '*.pl' -or -name 'VERSION' \) -exec cp {} $(BUILD)/include/ \; \
225-
&& mkdir -p $(BUILD)doc \
223+
mkdir -p $(BUILD)include $(BUILD)doc \
224+
&& find src -type f \( -name '*.mk' -or -name '*.pl' \) -exec cp {} $(BUILD)/include/ \; \
225+
&& echo "$(VERSION)" > $(BUILD)include/VERSION \
226226
&& cp \
227227
$(ROOT)LICENSE \
228-
$(ROOT)src/VERSION \
229228
$(ROOT)README.md \
230229
$(ROOT)doc/*.md \
231230
$(BUILD)doc

src/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/bmakelib.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ endif
126126
####################################################################################################
127127

128128
export bmakelib.ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
129-
export bmakelib.VERSION := $(file < $(bmakelib.ROOT)VERSION)
129+
export bmakelib.VERSION := $(or $(file < $(bmakelib.ROOT)VERSION),development)
130130

131131
####################################################################################################
132132

0 commit comments

Comments
 (0)