Skip to content

Commit 652325e

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 652325e

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

.github/workflows/push_rockspec.yaml

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

1313
jobs:
14+
version-check:
15+
# We need this job to run only on push with tag.
16+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- name: Check module version
20+
uses: tarantool/actions/check-module-version@master
21+
with:
22+
module-name: 'crud'
23+
1424
push-scm-rockspec:
1525
runs-on: ubuntu-20.04
1626
if: github.ref == 'refs/heads/master'
@@ -25,6 +35,7 @@ jobs:
2535
push-tagged-rockspec:
2636
runs-on: ubuntu-20.04
2737
if: startsWith(github.ref, 'refs/tags')
38+
needs: version-check
2839
steps:
2940
- uses: actions/checkout@master
3041

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
* Add versioning support (PR #342).
12+
1013
### Fixed
1114
* Pre-hotreload `cartridge` support (older than 2.4.0) (PR #341).
1215

crud.lua

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

2424
local crud = {}
2525

26+
-- @refer crud.version
27+
-- @tfield string _VERSION
28+
-- Module version.
29+
crud._VERSION = require('crud.version')
30+
2631
--- CRUD operations.
2732
-- @section crud
2833

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)