Skip to content

Commit b0c829a

Browse files
committed
feat: release v0.04
1 parent 2eda21f commit b0c829a

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
paths:
8+
- 'rockspec/**'
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Install Lua
19+
uses: leafo/gh-actions-lua@v8
20+
21+
- name: Install Luarocks
22+
uses: leafo/gh-actions-luarocks@v4
23+
24+
- name: Extract release name
25+
id: release_env
26+
shell: bash
27+
run: |
28+
title="${{ github.event.head_commit.message }}"
29+
re="^feat: release v*(\S+)"
30+
if [[ $title =~ $re ]]; then
31+
v=v${BASH_REMATCH[1]}
32+
echo "##[set-output name=version;]${v}"
33+
echo "##[set-output name=version_withou_v;]${BASH_REMATCH[1]}"
34+
else
35+
echo "commit format is not correct"
36+
exit 1
37+
fi
38+
39+
- name: Create Release
40+
uses: actions/create-release@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tag_name: ${{ steps.release_env.outputs.version }}
45+
release_name: ${{ steps.release_env.outputs.version }}
46+
draft: false
47+
prerelease: false
48+
49+
- name: Upload to luarocks
50+
env:
51+
LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
52+
run: |
53+
luarocks install dkjson
54+
luarocks upload rockspec/lua-resty-balancer-${{ steps.release_env.outputs.version_withou_v }}-0.rockspec --api-key=${LUAROCKS_TOKEN}

rockspec/lua-resty-balancer-0.04-0.rockspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ build = {
1616
type = "builtin",
1717
modules = {
1818
["librestychash"] = {"chash.c"},
19-
2019
["resty.chash"] = "lib/resty/chash.lua",
2120
["resty.roundrobin"] = "lib/resty/roundrobin.lua",
2221
["resty.balancer.utils"] = "lib/resty/balancer/utils.lua",

0 commit comments

Comments
 (0)