Skip to content

Commit d6bde4d

Browse files
committed
api: add hardcoded versioning support
Added the _VERSION variable to the exported table. Is part of the task [1]. 1. github.com/tarantool/roadmap-internal/issues/204
1 parent 6f041ee commit d6bde4d

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

.github/workflows/push_rockspec.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@ env:
1111
ROCK_NAME: "crud"
1212

1313
jobs:
14+
version-check:
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Check module version
18+
uses: tarantool/actions/check-module-version@igrishnov/gh-204-add-hardcoded-versioning-support
19+
with:
20+
module-name: 'crud'
21+
1422
push-scm-rockspec:
1523
runs-on: ubuntu-20.04
1624
if: github.ref == 'refs/heads/master'
25+
needs: version-check
1726
steps:
1827
- uses: actions/checkout@master
1928

@@ -25,6 +34,7 @@ jobs:
2534
push-tagged-rockspec:
2635
runs-on: ubuntu-20.04
2736
if: startsWith(github.ref, 'refs/tags')
37+
needs: version-check
2838
steps:
2939
- uses: actions/checkout@master
3040

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
* Add versioning support (PR #342).
910

1011
### Fixed
1112
* Pre-hotreload `cartridge` support (older than 2.4.0) (PR #341).

crud.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ local stats = require('crud.stats')
2323

2424
local crud = {}
2525

26+
-- @refer crud.version
27+
-- @tfield string _VERSION
28+
-- Contains hardcoded value of the CRUD version.
29+
-- The version value is marked in the separate file
30+
-- crud/version.lua and must be updated manually in
31+
-- case of release commit.
32+
-- Thus, it is possible to get the module version
33+
-- via require('crud')._VERSION as string value.
34+
crud._VERSION = require('crud.version')
35+
2636
--- CRUD operations.
2737
-- @section crud
2838

crud/version.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Сontains the module version.
2+
-- Requires manual update in case of release commit.
3+
4+
return '1.0.0'

0 commit comments

Comments
 (0)