Skip to content

Commit ef31f34

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 d597604 commit ef31f34

File tree

6 files changed

+31
-1
lines changed

6 files changed

+31
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ on:
66
tags: ['*']
77

88
jobs:
9+
version-check:
10+
# We need this job to run only on push with tag.
11+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: Check module version
15+
uses: tarantool/actions/check-module-version@master
16+
with:
17+
module-name: 'migrator'
18+
919
publish-scm-1:
1020
if: github.ref == 'refs/heads/master'
1121
runs-on: ubuntu-20.04
@@ -18,6 +28,7 @@ jobs:
1828

1929
publish-tag:
2030
if: startsWith(github.ref, 'refs/tags/')
31+
needs: version-check
2132
runs-on: ubuntu-20.04
2233
steps:
2334
- uses: actions/checkout@v2

.github/workflows/test_on_push.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ name: Run tests
33
on: [push]
44

55
jobs:
6+
version-check:
7+
# We need this job to run only on push with tag.
8+
#if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Check module version
12+
uses: tarantool/actions/check-module-version@master
13+
with:
14+
module-name: 'migrator'
15+
616
all:
717
runs-on: ubuntu-18.04
818
container:

CHANGELOG.md

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

77
## [Unreleased]
8+
### Added:
9+
- Versioning support
810

911
## [0.4.2]
1012
### Fixed:

migrations-scm-1.rockspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build = {
1717
install = {
1818
lua = {
1919
['migrator'] = 'migrator/init.lua',
20+
['migrator.version'] = 'migrator/version.lua',
2021
['migrator.utils'] = 'migrator/utils.lua',
2122
['migrator.directory-loader'] = 'migrator/directory-loader.lua',
2223
['migrator.config-loader'] = 'migrator/config-loader.lua',

migrator/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,7 @@ return {
176176
set_loader = set_loader,
177177
set_use_cartridge_ddl = set_use_cartridge_ddl,
178178

179-
get_schema = get_schema
179+
get_schema = get_schema,
180+
181+
_VERSION = require('migrator.version'),
180182
}

migrator/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 '0.4.2'

0 commit comments

Comments
 (0)