From af5ae840245ddfe102aa336e684ba5c369219ae7 Mon Sep 17 00:00:00 2001 From: themilchenko Date: Tue, 11 Nov 2025 19:21:02 +0300 Subject: [PATCH] ci: use dynamic tarantool in publish job --- .github/workflows/publish.yml | 135 +++++++++++++++++----------------- 1 file changed, 68 insertions(+), 67 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 64afc3c..035e7b9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,13 +2,13 @@ name: publish on: push: - branches: [master] - tags: ['*'] + # branches: [master] + # 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/') }} + # if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-22.04 steps: # We can not use 'tarantool/check-module-version' action since it installs Tarantool 2.10. @@ -16,16 +16,17 @@ jobs: - name: Clone the module uses: actions/checkout@v3 - - name: Install tarantool 3.1 - uses: tarantool/setup-tarantool@v3 - with: - tarantool-version: '3.1' - - name: Setup tt run: | curl -L https://tarantool.io/release/3/installer.sh | bash sudo apt install -y tt tt version + . <(tt env) + + - name: Install Tarantool 3.1 + uses: ./.github/actions/install-tarantool + with: + tarantool: '3.1' # https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions - name: Set env @@ -46,62 +47,62 @@ jobs: fi shell: bash - publish-rockspec-scm-1: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: tarantool/rocks.tarantool.org/github-action@master - with: - auth: ${{ secrets.ROCKS_AUTH }} - files: metrics-export-role-scm-1.rockspec - - publish-rockspec-tag: - if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} - needs: version-check - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - # Create a rockspec for the release. - - run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}" - - run: sed -E - -e 's/branch = ".+"/tag = "${{ env.TAG }}"/g' - -e 's/version = ".+"/version = "${{ env.TAG }}-1"/g' - metrics-export-role-scm-1.rockspec > metrics-export-role-${{ env.TAG }}-1.rockspec - - - name: Setup tt - run: | - curl -L https://tarantool.io/release/3/installer.sh | bash - sudo apt install -y tt - tt version - - # Create a rock for the release (.all.rock). - # - # `tt rocks pack ` creates - # .all.rock tarball. It speeds up - # `tt rocks install ` and - # frees it from dependency on git. - # - # Don't confuse this command with - # `tt rocks pack `, which creates a - # source tarball (.src.rock). - # - # Important: Don't upload binary rocks to - # rocks.tarantool.org. Lua/C modules should be packed into - # .src.rock instead. See [1] for description of rock types. - # - # [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks - - uses: tarantool/setup-tarantool@v3 - with: - tarantool-version: '3.1' - - run: tt rocks install metrics-export-role-${{ env.TAG }}-1.rockspec - - run: tt rocks pack metrics-export-role ${{ env.TAG }} - - # Upload .rockspec and .all.rock. - - uses: tarantool/rocks.tarantool.org/github-action@master - with: - auth: ${{ secrets.ROCKS_AUTH }} - files: | - metrics-export-role-${{ env.TAG }}-1.rockspec - metrics-export-role-${{ env.TAG }}-1.all.rock + # publish-rockspec-scm-1: + # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v3 + # - uses: tarantool/rocks.tarantool.org/github-action@master + # with: + # auth: ${{ secrets.ROCKS_AUTH }} + # files: metrics-export-role-scm-1.rockspec + # + # publish-rockspec-tag: + # if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} + # needs: version-check + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v3 + # + # # Create a rockspec for the release. + # - run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}" + # - run: sed -E + # -e 's/branch = ".+"/tag = "${{ env.TAG }}"/g' + # -e 's/version = ".+"/version = "${{ env.TAG }}-1"/g' + # metrics-export-role-scm-1.rockspec > metrics-export-role-${{ env.TAG }}-1.rockspec + # + # - name: Setup tt + # run: | + # curl -L https://tarantool.io/release/3/installer.sh | bash + # sudo apt install -y tt + # tt version + # + # # Create a rock for the release (.all.rock). + # # + # # `tt rocks pack ` creates + # # .all.rock tarball. It speeds up + # # `tt rocks install ` and + # # frees it from dependency on git. + # # + # # Don't confuse this command with + # # `tt rocks pack `, which creates a + # # source tarball (.src.rock). + # # + # # Important: Don't upload binary rocks to + # # rocks.tarantool.org. Lua/C modules should be packed into + # # .src.rock instead. See [1] for description of rock types. + # # + # # [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks + # - uses: tarantool/setup-tarantool@v3 + # with: + # tarantool-version: '3.1' + # - run: tt rocks install metrics-export-role-${{ env.TAG }}-1.rockspec + # - run: tt rocks pack metrics-export-role ${{ env.TAG }} + # + # # Upload .rockspec and .all.rock. + # - uses: tarantool/rocks.tarantool.org/github-action@master + # with: + # auth: ${{ secrets.ROCKS_AUTH }} + # files: | + # metrics-export-role-${{ env.TAG }}-1.rockspec + # metrics-export-role-${{ env.TAG }}-1.all.rock