From 78313b3593d2b5f22476e1a1e0905910ce1ba095 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 22 May 2022 15:22:43 +0800 Subject: [PATCH 1/3] [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 --- .github/workflows/patch_updater.yml | 5 +++-- CMakeLists.txt | 8 +++++--- VERSION.md | 1 + docs/source/conf.py | 8 ++++---- 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 VERSION.md diff --git a/.github/workflows/patch_updater.yml b/.github/workflows/patch_updater.yml index a16988399..428616492 100644 --- a/.github/workflows/patch_updater.yml +++ b/.github/workflows/patch_updater.yml @@ -6,6 +6,7 @@ on: env: TAG_COMMIT: 781ea3f.. + VERSION_FILE: VERSION.md BRANCH_NAME: patch_update jobs: @@ -28,10 +29,10 @@ jobs: - name: Insert Patch Count if: "!contains(steps.log.outputs.message, 'Updated Patch Count') && contains(steps.repo.outputs.message, 'lnis-uofu/OpenFPGA')" 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.name "github-actions[bot]" - git add CMakeLists.txt + git add ${VERSION_FILE} git commit -m "Updated Patch Count" - name: Push changes # push the output folder to your repo diff --git a/CMakeLists.txt b/CMakeLists.txt index 168795d87..0117721b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) # Version number -set(OPENFPGA_VERSION_MAJOR 1) -set(OPENFPGA_VERSION_MINOR 1) -set(OPENFPGA_VERSION_PATCH 215) +file (STRINGS "VERSION.md" VERSION_NUMBER) +string (REPLACE "." ";" VERSION_LIST ${VERSION_NUMBER}) +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") # Include user-defined functions diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 000000000..c13847ae7 --- /dev/null +++ b/VERSION.md @@ -0,0 +1 @@ +1.1.215 diff --git a/docs/source/conf.py b/docs/source/conf.py index 03c1cdb47..02a4256b8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -37,10 +37,10 @@ copyright = u'2018, Xifan Tang' author = u'Xifan Tang' # The short X.Y version -version = u'' -# The full version, including alpha/beta/rc tags -release = u'1.0' - +with open("VERSION.md") as ver_f: + version = ver_f.readline().rstrip() + # The full version, including alpha/beta/rc tags + release = version # -- General configuration --------------------------------------------------- From 7a0f796b7c14ea751f0fcaeab7f9cd0a450469b2 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 22 May 2022 15:27:22 +0800 Subject: [PATCH 2/3] [doc] add missing file link and show version number in frontpage README --- README.md | 2 ++ docs/source/VERSION.md | 1 + 2 files changed, 3 insertions(+) create mode 120000 docs/source/VERSION.md diff --git a/README.md b/README.md index fa5562f7a..33e731a13 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![Documentation Status](https://readthedocs.org/projects/openfpga/badge/?version=master)](https://openfpga.readthedocs.io/en/master/?badge=master) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lnis-uofu/OpenFPGA/master?urlpath=vscode) +Version: see [`VERSION.md`](VERSION.md) + ## Introduction The award-winning OpenFPGA framework is the **first open-source FPGA IP generator** supporting highly-customizable homogeneous FPGA architectures. OpenFPGA provides complete EDA support for customized FPGAs, including Verilog-to-bitstream generation and self-testing verification. OpenFPGA opens the door to democratizing FPGA technology and EDA techniques with agile prototyping approaches and constantly evolving EDA tools for chip designers and researchers. diff --git a/docs/source/VERSION.md b/docs/source/VERSION.md new file mode 120000 index 000000000..18473801d --- /dev/null +++ b/docs/source/VERSION.md @@ -0,0 +1 @@ +../../VERSION.md \ No newline at end of file From c4e2d73e35574e779ddab8bcab6d03565ac8117f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 00:02:23 +0000 Subject: [PATCH 3/3] Updated Patch Count --- VERSION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.md b/VERSION.md index c13847ae7..3e3c866e5 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -1.1.215 +1.1.222