Skip to content

Commit 3fc73bc

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 3fc73bc

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

.github/workflows/check_on_push.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ on:
55
pull_request:
66

77
jobs:
8+
version-check:
9+
if: |
10+
github.event_name == 'push' ||
11+
github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: Check module version
15+
uses: tarantool/actions/check-module-version@igrishnov/gh-204-add-hardcoded-versioning-support
16+
with:
17+
module-name: 'crud'
18+
819
run-static-analysis:
920
if: |
1021
github.event_name == 'push' ||

.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: 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+
-- Contains hardcoded value of the CRUD 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)