Skip to content

Commit 21f26d5

Browse files
ArtDuligurio
authored andcommitted
ci: test and publish rocks using GitHub Actions
Dropped release rockspecs: we store them on rocks.tarantool.org. Kept only scm-1 rockspec.
1 parent 6924917 commit 21f26d5

File tree

4 files changed

+98
-22
lines changed

4 files changed

+98
-22
lines changed

.github/workflows/fast_testing.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: fast_testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
linux:
10+
# We want to run on external PRs, but not on our own internal
11+
# PRs as they'll be run by the push to the branch.
12+
#
13+
# The main trick is described here:
14+
# https://github.com/Dart-Code/Dart-Code/pull/2375
15+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
tarantool:
21+
- '1.10'
22+
- '2.4'
23+
- '2.5'
24+
- '2.6'
25+
- '2.7'
26+
- '2.8'
27+
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Install tarantool ${{ matrix.tarantool }}
31+
uses: tarantool/setup-tarantool@v1
32+
with:
33+
tarantool-version: ${{ matrix.tarantool }}
34+
35+
- name: Clone the module
36+
uses: actions/checkout@v2
37+
38+
- run: make test

.github/workflows/publish.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['*']
7+
8+
jobs:
9+
publish-scm-1:
10+
if: github.ref == 'refs/heads/master'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: tarantool/rocks.tarantool.org/github-action@master
15+
with:
16+
auth: ${{ secrets.ROCKS_AUTH }}
17+
files: expirationd-scm-1.rockspec
18+
19+
publish-tag:
20+
if: startsWith(github.ref, 'refs/tags/')
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
# Create a rockspec for the release.
26+
- run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
27+
- run: sed -E
28+
-e 's/branch = ".+"/tag = "${{ env.TAG }}"/g'
29+
-e 's/version = ".+"/version = "${{ env.TAG }}-1"/g'
30+
expirationd-scm-1.rockspec > expirationd-${{ env.TAG }}-1.rockspec
31+
32+
# Create a rock for the release (.all.rock).
33+
#
34+
# `tarantoolctl rocks pack <module_name> <version>` creates
35+
# .all.rock tarball. It speeds up
36+
# `tarantoolctl rocks install <module_name> <version>` and
37+
# frees it from dependency on git.
38+
#
39+
# Don't confuse this command with
40+
# `tarantoolctl rocks pack <rockspec>`, which creates a
41+
# source tarball (.src.rock).
42+
#
43+
# Important: Don't upload binary rocks to
44+
# rocks.tarantool.org. Lua/C modules should be packed into
45+
# .src.rock instead. See [1] for description of rock types.
46+
#
47+
# [1]: https://github.com/luarocks/luarocks/wiki/Types-of-rocks
48+
- uses: tarantool/setup-tarantool@v1
49+
with:
50+
tarantool-version: '1.10'
51+
- run: tarantoolctl rocks install expirationd-${{ env.TAG }}-1.rockspec
52+
- run: tarantoolctl rocks pack expirationd ${{ env.TAG }}
53+
54+
# Upload .rockspec and .all.rock.
55+
- uses: tarantool/rocks.tarantool.org/github-action@master
56+
with:
57+
auth: ${{ secrets.ROCKS_AUTH }}
58+
files: |
59+
expirationd-${{ env.TAG }}-1.rockspec
60+
expirationd-${{ env.TAG }}-1.all.rock
File renamed without changes.

rockspecs/expirationd-1.0.1-1.rockspec

-22
This file was deleted.

0 commit comments

Comments
 (0)