Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
run: docker build dev/ -t resty-session

- name: Run tests
run: docker run -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make && make prove"
run: docker run -v $PWD:/test -w /test resty-session bash -c "luarocks --lua-version 5.1 make ./*.rockspec && make prove"
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
branches:
- "master"
paths:
- 'rockspecs/**'

permissions:
contents: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Lua
uses: leafo/gh-actions-lua@v10

- name: Install Luarocks
uses: leafo/gh-actions-luarocks@v4

- name: Extract release name
id: release_env
shell: bash
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
title="$COMMIT_MESSAGE"
re="^feat: release v*(\S+)"
if [[ $title =~ $re ]]; then
echo "version=v${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
echo "version_without_v=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
else
echo "commit format is not correct"
exit 1
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Create Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.release_env.outputs.version }}
run: |
gh release create "$VERSION" --title "$VERSION" --generate-notes

- name: Upload to luarocks
env:
LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
VERSION_WITHOUT_V: ${{ steps.release_env.outputs.version_without_v }}
run: |
luarocks install dkjson
luarocks upload "rockspecs/lua-resty-session-api7-${VERSION_WITHOUT_V}-0.rockspec" --api-key="${LUAROCKS_TOKEN}"
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
run: docker build dev/ -t resty-session

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

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

- name: Print report summary
run: docker run --network=host -v $PWD:/test -w /test resty-session sed -n '/Summary/,$p' luacov.report.out
36 changes: 36 additions & 0 deletions rockspecs/lua-resty-session-api7-4.1.6-0.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package = "lua-resty-session-api7"
version = "4.1.6-0"
source = {
url = "git+https://github.com/api7/lua-resty-session.git",
tag = "v4.1.6",
}
description = {
summary = "Session Library for OpenResty - Flexible and Secure",
detailed = "lua-resty-session is a secure, and flexible session library for OpenResty.",
homepage = "https://github.com/api7/lua-resty-session",
license = "BSD",
}
dependencies = {
"lua >= 5.1",
"lua-ffi-zlib >= 0.5",
"lua-resty-openssl >= 1.5.0",
}
build = {
type = "builtin",
modules = {
["resty.session"] = "lib/resty/session.lua",
["resty.session.dshm"] = "lib/resty/session/dshm.lua",
["resty.session.file"] = "lib/resty/session/file.lua",
["resty.session.file.thread"] = "lib/resty/session/file/thread.lua",
["resty.session.file.utils"] = "lib/resty/session/file/utils.lua",
["resty.session.memcached"] = "lib/resty/session/memcached.lua",
["resty.session.mysql"] = "lib/resty/session/mysql.lua",
["resty.session.postgres"] = "lib/resty/session/postgres.lua",
["resty.session.redis"] = "lib/resty/session/redis.lua",
["resty.session.redis.cluster"] = "lib/resty/session/redis/cluster.lua",
["resty.session.redis.sentinel"] = "lib/resty/session/redis/sentinel.lua",
["resty.session.redis.common"] = "lib/resty/session/redis/common.lua",
["resty.session.shm"] = "lib/resty/session/shm.lua",
["resty.session.utils"] = "lib/resty/session/utils.lua",
},
}
Loading