Skip to content

Commit ec1c3af

Browse files
committed
feat: release v4.1.6 (#2)
1 parent c6a6a82 commit ec1c3af

4 files changed

Lines changed: 106 additions & 3 deletions

File tree

‎.github/workflows/integration_tests.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
run: docker build dev/ -t resty-session
1717

1818
- name: Run tests
19-
run: docker run -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make && make prove"
19+
run: docker run -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make ./*.rockspec && make prove"

‎.github/workflows/release.yml‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
paths:
8+
- 'rockspecs/**'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- name: Install Lua
24+
uses: leafo/gh-actions-lua@v10
25+
26+
- name: Install Luarocks
27+
uses: leafo/gh-actions-luarocks@v4
28+
29+
- name: Extract release name
30+
id: release_env
31+
shell: bash
32+
env:
33+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
34+
run: |
35+
title="$COMMIT_MESSAGE"
36+
re="^feat: release v*(\S+)"
37+
if [[ $title =~ $re ]]; then
38+
echo "version=v${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
39+
echo "version_without_v=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "commit format is not correct"
42+
exit 1
43+
fi
44+
45+
- name: Create Release
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
VERSION: ${{ steps.release_env.outputs.version }}
49+
run: |
50+
if gh release view "$VERSION" >/dev/null 2>&1; then
51+
echo "release $VERSION already exists, skipping"
52+
else
53+
gh release create "$VERSION" --title "$VERSION" --generate-notes
54+
fi
55+
56+
- name: Upload to luarocks
57+
env:
58+
LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
59+
VERSION_WITHOUT_V: ${{ steps.release_env.outputs.version_without_v }}
60+
run: |
61+
rockspec="rockspecs/api7-lua-resty-session-${VERSION_WITHOUT_V}-0.rockspec"
62+
if [[ ! -f "$rockspec" ]]; then
63+
echo "rockspec not found: $rockspec"
64+
exit 1
65+
fi
66+
luarocks install dkjson
67+
luarocks upload "$rockspec" --api-key="${LUAROCKS_TOKEN}"

‎.github/workflows/unit_tests.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
run: docker build dev/ -t resty-session
3434

3535
- name: Run tests
36-
run: docker run --network=host -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make && make unit"
36+
run: docker run --network=host -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make ./*.rockspec && make unit"
3737

3838
- name: Generate report
39-
run: docker run --network=host -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make && luacov"
39+
run: docker run --network=host -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make ./*.rockspec && luacov"
4040

4141
- name: Print report summary
4242
run: docker run --network=host -v $PWD:/test -w /test resty-session sed -n '/Summary/,$p' luacov.report.out
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package = "api7-lua-resty-session"
2+
version = "4.1.6-0"
3+
source = {
4+
url = "git+https://github.com/api7/lua-resty-session.git",
5+
tag = "v4.1.6",
6+
}
7+
description = {
8+
summary = "Session Library for OpenResty - Flexible and Secure",
9+
detailed = "lua-resty-session is a secure, and flexible session library for OpenResty.",
10+
homepage = "https://github.com/api7/lua-resty-session",
11+
license = "BSD",
12+
}
13+
dependencies = {
14+
"lua >= 5.1",
15+
"lua-ffi-zlib >= 0.5",
16+
"lua-resty-openssl >= 1.5.0",
17+
}
18+
build = {
19+
type = "builtin",
20+
modules = {
21+
["resty.session"] = "lib/resty/session.lua",
22+
["resty.session.dshm"] = "lib/resty/session/dshm.lua",
23+
["resty.session.file"] = "lib/resty/session/file.lua",
24+
["resty.session.file.thread"] = "lib/resty/session/file/thread.lua",
25+
["resty.session.file.utils"] = "lib/resty/session/file/utils.lua",
26+
["resty.session.memcached"] = "lib/resty/session/memcached.lua",
27+
["resty.session.mysql"] = "lib/resty/session/mysql.lua",
28+
["resty.session.postgres"] = "lib/resty/session/postgres.lua",
29+
["resty.session.redis"] = "lib/resty/session/redis.lua",
30+
["resty.session.redis.cluster"] = "lib/resty/session/redis/cluster.lua",
31+
["resty.session.redis.sentinel"] = "lib/resty/session/redis/sentinel.lua",
32+
["resty.session.redis.common"] = "lib/resty/session/redis/common.lua",
33+
["resty.session.shm"] = "lib/resty/session/shm.lua",
34+
["resty.session.utils"] = "lib/resty/session/utils.lua",
35+
},
36+
}

0 commit comments

Comments
 (0)