Skip to content

Commit 9ffcf5d

Browse files
authored
chore: add automated releases github (#30)
1 parent 2380992 commit 9ffcf5d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write # Required to create releases
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Setup Lua
18+
uses: leafo/gh-actions-lua@v10
19+
with:
20+
luaVersion: "5.1"
21+
22+
- name: Setup LuaRocks
23+
uses: leafo/gh-actions-luarocks@v4
24+
25+
- name: Install dependencies
26+
run: make deps
27+
28+
- name: Run tests
29+
run: make test
30+
31+
- name: Run linter
32+
run: make lint
33+
34+
- name: Validate rockspec
35+
run: |
36+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
37+
ROCKSPEC_FILE="copy_with_context-${TAG_VERSION}-1.rockspec"
38+
if [ ! -f "$ROCKSPEC_FILE" ]; then
39+
echo "Error: Rockspec $ROCKSPEC_FILE not found"
40+
exit 1
41+
fi
42+
luarocks lint "$ROCKSPEC_FILE"
43+
44+
- name: Create Release
45+
uses: softprops/action-gh-release@v1
46+
with:
47+
generate_release_notes: true

0 commit comments

Comments
 (0)