-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (69 loc) · 2.61 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: publish
on:
push:
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/') }}
runs-on: ubuntu-22.04
steps:
- name: Check module version
uses: tarantool/actions/check-module-version@master
with:
module-name: 'metrics-export-role'
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/XodVosJ/release/3/installer.sh | bash
sudo apt install -y tt
tt version
# Create a rock for the release (.all.rock).
#
# `tt rocks pack <module_name> <version>` creates
# .all.rock tarball. It speeds up
# `tt rocks install <module_name> <version>` and
# frees it from dependency on git.
#
# Don't confuse this command with
# `tt rocks pack <rockspec>`, 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