Skip to content

Commit af5ae84

Browse files
committed
ci: use dynamic tarantool in publish job
1 parent f3d1491 commit af5ae84

File tree

1 file changed

+68
-67
lines changed

1 file changed

+68
-67
lines changed

.github/workflows/publish.yml

Lines changed: 68 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@ name: publish
22

33
on:
44
push:
5-
branches: [master]
6-
tags: ['*']
5+
# branches: [master]
6+
# tags: ['*']
77

88
jobs:
99
version-check:
1010
# We need this job to run only on push with tag.
11-
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
11+
# if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
1212
runs-on: ubuntu-22.04
1313
steps:
1414
# We can not use 'tarantool/check-module-version' action since it installs Tarantool 2.10.
1515
# For this module we need Tarantool 3.
1616
- name: Clone the module
1717
uses: actions/checkout@v3
1818

19-
- name: Install tarantool 3.1
20-
uses: tarantool/setup-tarantool@v3
21-
with:
22-
tarantool-version: '3.1'
23-
2419
- name: Setup tt
2520
run: |
2621
curl -L https://tarantool.io/release/3/installer.sh | bash
2722
sudo apt install -y tt
2823
tt version
24+
. <(tt env)
25+
26+
- name: Install Tarantool 3.1
27+
uses: ./.github/actions/install-tarantool
28+
with:
29+
tarantool: '3.1'
2930

3031
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
3132
- name: Set env
@@ -46,62 +47,62 @@ jobs:
4647
fi
4748
shell: bash
4849

49-
publish-rockspec-scm-1:
50-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
51-
runs-on: ubuntu-22.04
52-
steps:
53-
- uses: actions/checkout@v3
54-
- uses: tarantool/rocks.tarantool.org/github-action@master
55-
with:
56-
auth: ${{ secrets.ROCKS_AUTH }}
57-
files: metrics-export-role-scm-1.rockspec
58-
59-
publish-rockspec-tag:
60-
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
61-
needs: version-check
62-
runs-on: ubuntu-22.04
63-
steps:
64-
- uses: actions/checkout@v3
65-
66-
# Create a rockspec for the release.
67-
- run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
68-
- run: sed -E
69-
-e 's/branch = ".+"/tag = "${{ env.TAG }}"/g'
70-
-e 's/version = ".+"/version = "${{ env.TAG }}-1"/g'
71-
metrics-export-role-scm-1.rockspec > metrics-export-role-${{ env.TAG }}-1.rockspec
72-
73-
- name: Setup tt
74-
run: |
75-
curl -L https://tarantool.io/release/3/installer.sh | bash
76-
sudo apt install -y tt
77-
tt version
78-
79-
# Create a rock for the release (.all.rock).
80-
#
81-
# `tt rocks pack <module_name> <version>` creates
82-
# .all.rock tarball. It speeds up
83-
# `tt rocks install <module_name> <version>` and
84-
# frees it from dependency on git.
85-
#
86-
# Don't confuse this command with
87-
# `tt rocks pack <rockspec>`, which creates a
88-
# source tarball (.src.rock).
89-
#
90-
# Important: Don't upload binary rocks to
91-
# rocks.tarantool.org. Lua/C modules should be packed into
92-
# .src.rock instead. See [1] for description of rock types.
93-
#
94-
# [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks
95-
- uses: tarantool/setup-tarantool@v3
96-
with:
97-
tarantool-version: '3.1'
98-
- run: tt rocks install metrics-export-role-${{ env.TAG }}-1.rockspec
99-
- run: tt rocks pack metrics-export-role ${{ env.TAG }}
100-
101-
# Upload .rockspec and .all.rock.
102-
- uses: tarantool/rocks.tarantool.org/github-action@master
103-
with:
104-
auth: ${{ secrets.ROCKS_AUTH }}
105-
files: |
106-
metrics-export-role-${{ env.TAG }}-1.rockspec
107-
metrics-export-role-${{ env.TAG }}-1.all.rock
50+
# publish-rockspec-scm-1:
51+
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
52+
# runs-on: ubuntu-22.04
53+
# steps:
54+
# - uses: actions/checkout@v3
55+
# - uses: tarantool/rocks.tarantool.org/github-action@master
56+
# with:
57+
# auth: ${{ secrets.ROCKS_AUTH }}
58+
# files: metrics-export-role-scm-1.rockspec
59+
#
60+
# publish-rockspec-tag:
61+
# if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
62+
# needs: version-check
63+
# runs-on: ubuntu-22.04
64+
# steps:
65+
# - uses: actions/checkout@v3
66+
#
67+
# # Create a rockspec for the release.
68+
# - run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
69+
# - run: sed -E
70+
# -e 's/branch = ".+"/tag = "${{ env.TAG }}"/g'
71+
# -e 's/version = ".+"/version = "${{ env.TAG }}-1"/g'
72+
# metrics-export-role-scm-1.rockspec > metrics-export-role-${{ env.TAG }}-1.rockspec
73+
#
74+
# - name: Setup tt
75+
# run: |
76+
# curl -L https://tarantool.io/release/3/installer.sh | bash
77+
# sudo apt install -y tt
78+
# tt version
79+
#
80+
# # Create a rock for the release (.all.rock).
81+
# #
82+
# # `tt rocks pack <module_name> <version>` creates
83+
# # .all.rock tarball. It speeds up
84+
# # `tt rocks install <module_name> <version>` and
85+
# # frees it from dependency on git.
86+
# #
87+
# # Don't confuse this command with
88+
# # `tt rocks pack <rockspec>`, which creates a
89+
# # source tarball (.src.rock).
90+
# #
91+
# # Important: Don't upload binary rocks to
92+
# # rocks.tarantool.org. Lua/C modules should be packed into
93+
# # .src.rock instead. See [1] for description of rock types.
94+
# #
95+
# # [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks
96+
# - uses: tarantool/setup-tarantool@v3
97+
# with:
98+
# tarantool-version: '3.1'
99+
# - run: tt rocks install metrics-export-role-${{ env.TAG }}-1.rockspec
100+
# - run: tt rocks pack metrics-export-role ${{ env.TAG }}
101+
#
102+
# # Upload .rockspec and .all.rock.
103+
# - uses: tarantool/rocks.tarantool.org/github-action@master
104+
# with:
105+
# auth: ${{ secrets.ROCKS_AUTH }}
106+
# files: |
107+
# metrics-export-role-${{ env.TAG }}-1.rockspec
108+
# metrics-export-role-${{ env.TAG }}-1.all.rock

0 commit comments

Comments
 (0)