-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (56 loc) · 2.15 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: publish
on:
push:
branches: [master]
tags: ['*']
jobs:
publish-rockspec-scm-1:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
files: memcached-scm-1.rockspec
publish-rockspec-tag:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
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"
memcached-scm-1.rockspec > memcached-${{ env.TAG }}-1.rockspec
# Create a source tarball for the release (.src.rock).
#
# `tarantoolctl rocks pack <rockspec>` creates a source
# tarball. It speeds up
# `tarantoolctl rocks install <module_name> <version>` and
# frees it from dependency on git.
#
# Important: Don't confuse this command with
# `tarantoolctl rocks pack <module_name> [<version>]`, which
# creates a **binary** rock or .all.rock (see [1]). Don't
# upload a binary rock of a Lua/C module to
# rocks.tarantool.org. Lua/C modules are platform dependent.
#
# A 'pure Lua' module is packed into the .all.rock tarball.
# Feel free to upload such rock to rocks.tarantool.org.
# Don't be confused by the 'pure Lua' words: usage of
# LuaJIT's FFI and tarantool specific features are okay.
#
# [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks
- uses: tarantool/setup-tarantool@v2
with:
tarantool-version: '2.10'
- run: tarantoolctl rocks pack memcached-${{ env.TAG }}-1.rockspec
# Upload .rockspec and .src.rock.
- uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
files: |
memcached-${{ env.TAG }}-1.rockspec
memcached-${{ env.TAG }}-1.src.rock