Skip to content

Commit ce9e2e4

Browse files
DifferentialOrangeLeonidVas
authored andcommitted
cd: publish rockspecs
Publish scm-1 rockspec with CI on push to master. Create and publish tagged rockspecs on tag push.
1 parent e1a9ba4 commit ce9e2e4

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags:
8+
- '*'
9+
10+
env:
11+
ROCK_NAME: 'mysql'
12+
13+
jobs:
14+
publish-rockspec-scm-1:
15+
runs-on: ubuntu-20.04
16+
if: github.ref == 'refs/heads/master'
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- uses: tarantool/rocks.tarantool.org/github-action@master
21+
with:
22+
auth: ${{ secrets.ROCKS_AUTH }}
23+
files: ${{ env.ROCK_NAME }}-scm-1.rockspec
24+
25+
publish-rockspec-tag:
26+
runs-on: ubuntu-20.04
27+
if: startsWith(github.ref, 'refs/tags')
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
32+
- name: Set env
33+
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
34+
35+
- name: Create release rockspec
36+
run: |
37+
sed \
38+
-e "s/branch = '.\+'/tag = '${GIT_TAG}'/g" \
39+
-e "s/version = '.\+'/version = '${GIT_TAG}-1'/g" \
40+
${{ env.ROCK_NAME }}-scm-1.rockspec > ${{ env.ROCK_NAME }}-${GIT_TAG}-1.rockspec
41+
- uses: tarantool/rocks.tarantool.org/github-action@master
42+
with:
43+
auth: ${{ secrets.ROCKS_AUTH }}
44+
files: ${{ env.ROCK_NAME }}-${GIT_TAG}-1.rockspec

0 commit comments

Comments
 (0)