[Misc] Now version number is in a separated file; Cmakefile and doc read the file and build version number on fly; CI can also update version

This commit is contained in:
tangxifan 2022-05-22 15:22:43 +08:00
parent cdb9b5ed7d
commit 78313b3593
4 changed files with 13 additions and 9 deletions

View File

@ -6,6 +6,7 @@ on:
env: env:
TAG_COMMIT: 781ea3f.. TAG_COMMIT: 781ea3f..
VERSION_FILE: VERSION.md
BRANCH_NAME: patch_update BRANCH_NAME: patch_update
jobs: jobs:
@ -28,10 +29,10 @@ jobs:
- name: Insert Patch Count - name: Insert Patch Count
if: "!contains(steps.log.outputs.message, 'Updated Patch Count') && contains(steps.repo.outputs.message, 'lnis-uofu/OpenFPGA')" if: "!contains(steps.log.outputs.message, 'Updated Patch Count') && contains(steps.repo.outputs.message, 'lnis-uofu/OpenFPGA')"
run: | run: |
sed -i "/^set(OPENFPGA_VERSION_PATCH /s/[0-9]*)/`git log ${TAG_COMMIT} --oneline | wc -l`)/" CMakeLists.txt sed -i "s/[0-9]*$/`git log ${TAG_COMMIT} --oneline | wc -l`/" ${VERSION_FILE}
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]" git config --local user.name "github-actions[bot]"
git add CMakeLists.txt git add ${VERSION_FILE}
git commit -m "Updated Patch Count" git commit -m "Updated Patch Count"
- name: Push changes # push the output folder to your repo - name: Push changes # push the output folder to your repo

View File

@ -51,9 +51,11 @@ set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics libr
set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on) set_property(CACHE VPR_USE_EZGL PROPERTY STRINGS auto off on)
# Version number # Version number
set(OPENFPGA_VERSION_MAJOR 1) file (STRINGS "VERSION.md" VERSION_NUMBER)
set(OPENFPGA_VERSION_MINOR 1) string (REPLACE "." ";" VERSION_LIST ${VERSION_NUMBER})
set(OPENFPGA_VERSION_PATCH 215) list(GET VERSION_LIST 0 OPENFPGA_VERSION_MAJOR)
list(GET VERSION_LIST 1 OPENFPGA_VERSION_MINOR)
list(GET VERSION_LIST 2 OPENFPGA_VERSION_PATCH)
set(OPENFPGA_VERSION_PRERELEASE "dev") set(OPENFPGA_VERSION_PRERELEASE "dev")
# Include user-defined functions # Include user-defined functions

1
VERSION.md Normal file
View File

@ -0,0 +1 @@
1.1.215

View File

@ -37,10 +37,10 @@ copyright = u'2018, Xifan Tang'
author = u'Xifan Tang' author = u'Xifan Tang'
# The short X.Y version # The short X.Y version
version = u'' with open("VERSION.md") as ver_f:
# The full version, including alpha/beta/rc tags version = ver_f.readline().rstrip()
release = u'1.0' # The full version, including alpha/beta/rc tags
release = version
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------