-
Notifications
You must be signed in to change notification settings - Fork 14
56 lines (47 loc) · 1.54 KB
/
push_rockspec.yaml
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
name: Push rockspec
on:
push:
branches:
- master
tags:
- '*'
env:
ROCK_NAME: "crud"
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-20.04
steps:
- name: Check module version
uses: tarantool/actions/check-module-version@master
with:
module-name: 'crud'
push-scm-rockspec:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@master
- uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
files: ${{ env.ROCK_NAME }}-scm-1.rockspec
push-tagged-rockspec:
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags')
needs: version-check
steps:
- uses: actions/checkout@master
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- name: Set env
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create release rockspec
run: |
sed \
-e "s/branch = '.\+'/tag = '${GIT_TAG}'/g" \
-e "s/version = '.\+'/version = '${GIT_TAG}-1'/g" \
${{ env.ROCK_NAME }}-scm-1.rockspec > ${{ env.ROCK_NAME }}-${GIT_TAG}-1.rockspec
- uses: tarantool/rocks.tarantool.org/github-action@master
with:
auth: ${{ secrets.ROCKS_AUTH }}
files: ${{ env.ROCK_NAME }}-${GIT_TAG}-1.rockspec