forked from cerc-io/stack-orchestrator
New build version scheme (#305)
* Use separate build tag file
* Implement new versioning scheme
* Update workflow file
Former-commit-id: 80bbbafeb6
This commit is contained in:
parent
bf85c61711
commit
f90000d9cc
@ -13,15 +13,11 @@ jobs:
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Get build info" # TODO: put this in a library
|
||||
- name: "Get build info"
|
||||
id: build-info
|
||||
run: |
|
||||
build_time=$(date +'%Y%m%d%H%M')
|
||||
product_version=$( cat app/data/version.txt )
|
||||
short_sha=$(git rev-parse --short HEAD)
|
||||
build_tag=$(echo "v${product_version}-${short_sha}-${build_time}")
|
||||
echo "build-time=${build_time}" >> $GITHUB_OUTPUT
|
||||
echo "short-sha=${short_sha}" >> $GITHUB_OUTPUT
|
||||
./scripts/create_build_tag_file.sh
|
||||
build_tag=$(cat ./app/data/build_tag.txt)
|
||||
echo "build-tag=${build_tag}" >> $GITHUB_OUTPUT
|
||||
- name: "Install Python"
|
||||
uses: cerc-io/setup-python@v4
|
||||
|
@ -23,7 +23,7 @@ def command(ctx):
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "version.txt") as version_file:
|
||||
with importlib.resources.open_text(data, "build_tag.txt") as version_file:
|
||||
# TODO: code better version that skips comment lines
|
||||
version_string = version_file.read().splitlines()[1]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Builds the shiv "package" for distribution
|
||||
mkdir -p ./package
|
||||
version_string=$( ./scripts/update_version_file.sh)
|
||||
version_string=$( ./app/data/version.txt )
|
||||
shiv -c laconic-so -o package/laconic-so-${version_string} .
|
||||
|
8
scripts/create_build_tag_file.sh
Executable file
8
scripts/create_build_tag_file.sh
Executable file
@ -0,0 +1,8 @@
|
||||
build_tag_file_name=./app/data/build_tag.txt
|
||||
echo "# This file should be re-generated running: scripts/create_build_tag_file.sh script" > $build_tag_file_name
|
||||
product_version_string=$( tail -1 ./app/data/version.txt )
|
||||
commit_string=$( git rev-parse --short HEAD )
|
||||
timestamp_string=$(date +'%Y%m%d%H%M')
|
||||
build_tag_string=${product_version_string}-${commit_string}-${timestamp_string}
|
||||
echo ${build_tag_string} >> $build_tag_file_name
|
||||
echo ${build_tag_string}
|
@ -1,7 +0,0 @@
|
||||
version_file_name=./app/data/version.txt
|
||||
echo "# This file should be re-generated running: scripts/update-version-file.sh script" > $version_file_name
|
||||
tag_string=$( git describe --tags --abbrev=0 )
|
||||
commit_string=$( git rev-parse --short HEAD )
|
||||
version_string=${tag_string}-${commit_string}
|
||||
echo ${version_string} >> $version_file_name
|
||||
echo ${version_string}
|
Loading…
Reference in New Issue
Block a user