From 53bb17efe763bc31fae0fc68d79f16b61a1c8a52 Mon Sep 17 00:00:00 2001 From: Ilya Grishnov Date: Wed, 22 Feb 2023 11:45:21 +0300 Subject: [PATCH] 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 --- .github/workflows/publish.yml | 11 +++++++++++ CHANGELOG.md | 4 ++++ errors.lua | 2 ++ errors/version.lua | 4 ++++ 4 files changed, 21 insertions(+) create mode 100644 errors/version.lua diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 77056f6..ec6b823 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,16 @@ on: tags: ['*'] 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: 'errors' + publish-scm-1: if: github.ref == 'refs/heads/master' runs-on: ubuntu-20.04 @@ -18,6 +28,7 @@ jobs: publish-tag: if: startsWith(github.ref, 'refs/tags/') + needs: version-check runs-on: ubuntu-20.04 env: CMAKE_LDOC_FIND_REQUIRED: 'YES' diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b52aca..b5dacfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Add versioning support. + ## [2.2.1] - 2021-08-16 ### Fixed diff --git a/errors.lua b/errors.lua index e6b8a92..bcdc0b6 100755 --- a/errors.lua +++ b/errors.lua @@ -561,6 +561,8 @@ local function errors_assert(class_name, ...) end return { + _VERSION = require('errors.version'), + list = list, new_class = new_class, netbox_call = netbox_call, diff --git a/errors/version.lua b/errors/version.lua new file mode 100644 index 0000000..b2c69e0 --- /dev/null +++ b/errors/version.lua @@ -0,0 +1,4 @@ +-- Сontains the module version. +-- Requires manual update in case of release commit. + +return '2.2.1'