-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1.18 KB
/
release.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
name: Release Rock
on:
push:
tags:
- 'v*' # Trigger for version tags
jobs:
build_and_release:
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check if rockspec files are present
run: |
VERSION="$(make release-info | grep -oP '^VERSION=\K.*')"
ROCKSPEC_RELEASE_FILE="$(make release-info | grep -oP '^ROCKSPEC_RELEASE_FILE=\K.*')"
if [ ! -f "${ROCKSPEC_RELEASE_FILE}" ]; then
echo "No ${ROCKSPEC_RELEASE_FILE} file found. Exiting."
exit 1
fi
# Compare tag with version with VERSION
if [ "${{ github.ref_name }}" != "${VERSION}" ]; then
echo "${{ github.ref_name }} does not match version ${VERSION}. Exiting."
exit 1
fi
- name: Publish to LuaRocks
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
run: |
ROCKSPEC_RELEASE_FILE="$(make release-info | grep -oP '^ROCKSPEC_RELEASE_FILE=\K.*')"
luarocks upload --temp-key="${LUAROCKS_API_KEY}" "${ROCKSPEC_RELEASE_FILE}"