-
Notifications
You must be signed in to change notification settings - Fork 30
73 lines (56 loc) · 1.81 KB
/
publishing.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
name: publishing
on:
push:
branches:
- master
tags:
- '*'
workflow_dispatch:
env:
ROCK_NAME: vshard
jobs:
scm:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Push scm rockspec
uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
files: ${{ env.ROCK_NAME }}-scm-1.rockspec
version-check:
# We need to run this job only on tag push.
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Check module version
uses: tarantool/actions/check-module-version@master
with:
module-name: vshard
release:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: version-check
steps:
- uses: actions/checkout@v3
- uses: tarantool/setup-tarantool@v2
with:
tarantool-version: '2.10'
- name: Create release rockspec
run: >
sed -e "s/version = '.\+'/version = '${{ github.ref_name }}-1'/g"
-e "s/branch = '.\+'/tag = '${{ github.ref_name }}'/g"
${{ env.ROCK_NAME }}-scm-1.rockspec >
${{ env.ROCK_NAME }}-${{ github.ref_name }}-1.rockspec
- name: Create release rock
run: |
tarantoolctl rocks install ${{ env.ROCK_NAME }}-${{ github.ref_name }}-1.rockspec
tarantoolctl rocks pack ${{ env.ROCK_NAME }} ${{ github.ref_name }}
- name: Push release rockspec and rock
uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
files: |
${{ env.ROCK_NAME }}-${{ github.ref_name }}-1.rockspec
${{ env.ROCK_NAME }}-${{ github.ref_name }}-1.all.rock