-
Notifications
You must be signed in to change notification settings - Fork 5
84 lines (66 loc) · 2.52 KB
/
publish.yaml
File metadata and controls
84 lines (66 loc) · 2.52 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Publish
on:
push:
branches: [ligurio/tmate]
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
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 120
if: ${{ failure() }}
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: sed -i -E
-e 's#branch = "master"#branch = "${{ github.head_ref || github.ref_name }}"#g'
luzer-scm-1.rockspec
- run: luarocks --local build luzer-scm-1.rockspec
- run: |
luarocks --local install luzer-scm-1.rockspec
eval $(luarocks path)
lua -l luzer
- run: luarocks --local make
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 120
if: ${{ failure() }}