File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 5
5
pull_request :
6
6
7
7
jobs :
8
+ hardcoded_ver_check :
9
+ runs-on : ubuntu-20.04
10
+
11
+ steps :
12
+ - name : Clone the module
13
+ uses : actions/checkout@v2
14
+
15
+ - name : Fetch tags
16
+ # Found that Github checkout Actions pulls all the tags, but
17
+ # right it deannotates the testing tag, check:
18
+ # https://github.com/actions/checkout/issues/290
19
+ # But we use 'git describe ..' calls w/o '--tags' flag and it
20
+ # prevents us from getting the needed tag for packages version
21
+ # setup. To avoid of it, let's fetch it manually, to be sure
22
+ # that all tags will exists always.
23
+ run : git fetch --tags -f
24
+
25
+ - name : Fetch hardcoded and last repository tag versions
26
+ run : |
27
+ echo HARDCODED_VERSION=$(cat crud/version.lua | grep -oP "'\K[^']+" ) >> $GITHUB_ENV
28
+ echo REPO_LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) >> $GITHUB_ENV
29
+
30
+ - name : Hardcoded version relevance check
31
+ if : env.HARDCODED_VERSION != env.REPO_LAST_TAG
32
+ run : |
33
+ echo "Hardcoded version and the last repository tag are not equal"
34
+ echo "You may have forgotten to update the value in the version.lua file"
35
+ exit 1
36
+
8
37
run-tests-ce :
9
38
if : |
10
39
github.event_name == 'push' ||
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
7
7
8
8
## [ Unreleased]
9
+ * Add versioning support (PR #342 ).
9
10
10
11
### Fixed
11
12
* Pre-hotreload ` cartridge ` support (older than 2.4.0) (PR #341 ).
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ local stats = require('crud.stats')
23
23
24
24
local crud = {}
25
25
26
+ -- @refer crud.version
27
+ -- @field _VERSION
28
+ -- Contains hardcoded value of the CRUD version.
29
+ crud ._VERSION = require (' crud.version' )
30
+
26
31
--- CRUD operations.
27
32
-- @section crud
28
33
Original file line number Diff line number Diff line change
1
+ -- Сontains the module version.
2
+ -- Requires manual update in case of release commit.
3
+
4
+ return ' 1.0.0'
You can’t perform that action at this time.
0 commit comments