-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (31 loc) · 876 Bytes
/
publish.yml
File metadata and controls
36 lines (31 loc) · 876 Bytes
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
name: Publish to LuaRocks
on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g. 0.1.5)'
required: true
push:
tags:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LuaRocks
uses: hishamhm/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Upload to LuaRocks
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
run: |
TAG="${{ github.event.inputs.version || github.ref_name }}"
ROCKSPEC="lua-reqwest-${TAG}-1.rockspec"
if [ ! -f "$ROCKSPEC" ]; then
echo "Error: $ROCKSPEC not found"
exit 1
fi
luarocks upload "$ROCKSPEC" --api-key="$LUAROCKS_API_KEY"