diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 4290a01..0539afa 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -10,8 +10,20 @@ on: - '*' jobs: + # Run not only on tags, otherwise dependent job will skip. + version-check: + runs-on: ubuntu-20.04 + steps: + - name: Check module version + # We need this step to run only on push with tag. + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} + uses: tarantool/actions/check-module-version@master + with: + module-name: 'http.server' + package: runs-on: ubuntu-latest + needs: version-check strategy: fail-fast: false diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f33c88a..b3ff487 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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: 'http.server' + publish-scm-1: if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest @@ -18,6 +28,7 @@ jobs: publish-tag: if: startsWith(github.ref, 'refs/tags/') + needs: version-check runs-on: ubuntu-latest steps: # Create a source tarball for the release (.src.rock). diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d7343a..6c7ae42 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. + ## [1.4.0] - 2022-12-30 ### Added diff --git a/http/CMakeLists.txt b/http/CMakeLists.txt index 6163638..27ae542 100644 --- a/http/CMakeLists.txt +++ b/http/CMakeLists.txt @@ -13,5 +13,6 @@ set_target_properties(httpd # Install install(TARGETS httpd LIBRARY DESTINATION ${TARANTOOL_INSTALL_LIBDIR}/http) install(FILES server.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR}/http) +install(FILES version.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR}/http) install(FILES mime_types.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR}/http) install(FILES codes.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR}/http) diff --git a/http/server.lua b/http/server.lua index 7a53808..79ecc75 100644 --- a/http/server.lua +++ b/http/server.lua @@ -1294,6 +1294,7 @@ local function httpd_start(self) end local exports = { + _VERSION = require('http.version'), DETACHED = DETACHED, new = function(host, port, options) diff --git a/http/version.lua b/http/version.lua new file mode 100644 index 0000000..0534705 --- /dev/null +++ b/http/version.lua @@ -0,0 +1,4 @@ +-- Сontains the module version. +-- Requires manual update in case of release commit. + +return '1.4.0'