-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (51 loc) · 1.98 KB
/
publish.yaml
File metadata and controls
65 lines (51 loc) · 1.98 KB
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
name: Publish
on:
push:
branches: [master]
tags: ['*']
jobs:
publish-scm-1:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup luarocks
run: sudo apt install -y luarocks
- name: Setup cjson (required for upload)
run: luarocks install --local lua-cjson
- name: Upload rockspec scm-1
run: luarocks upload --force --api-key=${{ secrets.LUAROCKS_API_KEY }} luzer-scm-1.rockspec
publish-tag:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
# https://github.com/luarocks/luarocks/wiki/Types-of-rocks
- uses: actions/checkout@v3
- name: Setup luarocks
run: sudo apt install -y luarocks
# Create a rockspec for the release.
- run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
- run: sed -E
-e "s/branch = '.+'/tag = '${{ env.TAG }}'/g"
-e "s/version = '.+'/version = '${{ env.TAG }}-1'/g"
luzer-scm-1.rockspec > luzer-${{ env.TAG }}-1.rockspec
# Make a release.
- run: |
luarocks new_version --tag ${{ env.TAG }}
luarocks install luzer-${{ env.TAG }}-1.rockspec
luarocks pack luzer-${{ env.TAG }}-1.rockspec
- name: Upload .rockspec and .src.rock ${{ env.TAG }}
run: |
luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY }} luzer-${{ env.TAG }}-1.rockspec
luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY }} luzer-${{ env.TAG }}-1.src.rock
build-rock:
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y luarocks lua5.2 liblua5.2-dev libclang-common-14-dev clang-14
- run: luarocks --local build luzer-scm-1.rockspec
- run: luarocks --local make