Skip to content

Commit

Permalink
api: add hardcoded versioning support
Browse files Browse the repository at this point in the history
Added the _VERSION variable to the exported table.
Is part of the task [1].

1. github.com/tarantool/roadmap-internal/issues/204
  • Loading branch information
GRISHNOV authored and DifferentialOrange committed Mar 10, 2023
1 parent 9f5566f commit cf1d1fe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/push_rockspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ env:
ROCK_NAME: "crud"

jobs:
version-check:
# We need this job to run only on push with tag.
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-20.04
steps:
- name: Check module version
uses: tarantool/actions/check-module-version@master
with:
module-name: 'crud'

push-scm-rockspec:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master'
Expand All @@ -25,6 +35,7 @@ jobs:
push-tagged-rockspec:
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags')
needs: version-check
steps:
- uses: actions/checkout@master

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added
* Add versioning support (PR #342).

### Fixed
* Pre-hotreload `cartridge` support (older than 2.4.0) (PR #341).
* Tarantool version-dependent features for 3.x (PR #344).
Expand Down
5 changes: 5 additions & 0 deletions crud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ local stats = require('crud.stats')

local crud = {}

-- @refer crud.version
-- @tfield string _VERSION
-- Module version.
crud._VERSION = require('crud.version')

--- CRUD operations.
-- @section crud

Expand Down
4 changes: 4 additions & 0 deletions crud/version.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Сontains the module version.
-- Requires manual update in case of release commit.

return '1.0.0'

0 comments on commit cf1d1fe

Please sign in to comment.