Skip to content

Commit 2e01cb5

Browse files
committed
cd: add rockspec publishing
Closes #178
1 parent 813be24 commit 2e01cb5

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/publish.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['*']
7+
8+
jobs:
9+
publish-rockspec-scm-1:
10+
if: github.ref == 'refs/heads/master'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: tarantool/rocks.tarantool.org/github-action@master
15+
with:
16+
auth: ${{ secrets.ROCKS_AUTH }}
17+
files: queue-scm-1.rockspec
18+
19+
publish-rockspec-tag:
20+
if: startsWith(github.ref, 'refs/tags/')
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
# Create a rockspec for the release.
26+
- run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
27+
sed -E
28+
-e "s/branch = '.+'/tag = '${{ env.TAG }}'/g"
29+
-e "s/version = '.+'/version = '${{ env.TAG }}-1'/g"
30+
queue-scm-1.rockspec > queue-${{ env.TAG }}-1.rockspec
31+
32+
# Create a rock for the release (.all.rock).
33+
#
34+
# `tarantoolctl rocks pack <module_name> <version>` creates
35+
# .all.rock tarball. It speeds up
36+
# `tarantoolctl rocks install <module_name> <version>` and
37+
# frees it from dependency on git.
38+
#
39+
# Don't confuse this command with
40+
# `tarantoolctl rocks pack <rockspec>`, which creates a
41+
# source tarball (.src.rock).
42+
#
43+
# Important: Don't upload binary rocks to
44+
# rocks.tarantool.org. Lua/C modules should be packed into
45+
# .src.rock instead. See [1] for description of rock types.
46+
#
47+
# [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks
48+
- uses: tarantool/setup-tarantool@v1
49+
with:
50+
tarantool-version: '1.10'
51+
- run: tarantoolctl rocks install queue-${{ env.TAG }}-1.rockspec
52+
- run: tarantoolctl rocks pack queue ${{ env.TAG }}
53+
54+
# Upload .rockspec and .all.rock.
55+
- uses: tarantool/rocks.tarantool.org/github-action@master
56+
with:
57+
auth: ${{ secrets.ROCKS_AUTH }}
58+
files: |
59+
queue-${{ env.TAG }}-1.rockspec
60+
queue-${{ env.TAG }}-1.all.rock

0 commit comments

Comments
 (0)