-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (52 loc) · 2.12 KB
/
push-rockspec.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
name: Create and push rockspec for moonlibs/algo
on:
workflow_dispatch:
workflows:
- "Testing with unit tests"
types:
- completed
push:
tags:
- '*'
env:
ROCK_NAME: algo
jobs:
pack-and-push-tagged-rockspec:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} && startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v3
- uses: tarantool/setup-tarantool@v3
with:
tarantool-version: '2.10.4'
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- name: Set env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: tarantoolctl rocks new_version --tag=${{ env.TAG }} rockspecs/${{env.ROCK_NAME}}-scm-1.rockspec ${{ env.TAG }} "git+https://github.com/${{ github.repository }}.git"
- run: tarantoolctl rocks install ${{ env.ROCK_NAME }}-${{ env.TAG }}-1.rockspec
- run: tarantoolctl rocks pack ${{ env.ROCK_NAME }}-${{ env.TAG }}-1.rockspec
# Install native lua with luarocks
- uses: leafo/gh-actions-lua@v9
with:
luaVersion: "luajit-2.1.0-beta3"
- uses: leafo/gh-actions-luarocks@v4
with:
luarocksVersion: "3.8.0"
- uses: unfor19/[email protected]
- run: mkdir .build && cp rockspecs/${{env.ROCK_NAME}}-scm-1.rockspec ${{env.ROCK_NAME}}-${{env.TAG}}-1.rockspec .build/ && cp *.src.rock .build/
- name: rebuild and publish s3 luarocks server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.MOONLIBS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MOONLIBS_S3_SECRET_KEY}}
AWS_EC2_METADATA_DISABLED: true
run: |
cd .build && aws s3 sync s3://moonlibs/ ./ && luarocks-admin make_manifest . && aws s3 sync --acl public-read ./ s3://moonlibs/;
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
README.md
${{env.ROCK_NAME}}-scm-1.rockspec
${{env.ROCK_NAME}}-${{env.TAG}}-1.rockspec
${{env.ROCK_NAME}}-${{env.TAG}}-1.src.rock