Skip to content

Commit 9b00f49

Browse files
committed
feat: release v0.9.6
1 parent d4e69f1 commit 9b00f49

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.github/workflows/release.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
with:
24+
luarocksVersion: "3.8.0"
25+
26+
- name: Extract release name
27+
id: release_env
28+
shell: bash
29+
run: |
30+
title="${{ github.event.head_commit.message }}"
31+
re="^feat: release v*(\S+)"
32+
if [[ $title =~ $re ]]; then
33+
v=v${BASH_REMATCH[1]}
34+
echo "##[set-output name=version;]${v}"
35+
echo "##[set-output name=version_withou_v;]${BASH_REMATCH[1]}"
36+
else
37+
echo "commit format is not correct"
38+
exit 1
39+
fi
40+
41+
- name: Create Release
42+
uses: actions/create-release@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
tag_name: ${{ steps.release_env.outputs.version }}
47+
release_name: ${{ steps.release_env.outputs.version }}
48+
draft: false
49+
prerelease: false
50+
51+
- name: Upload to luarocks
52+
env:
53+
LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
54+
run: |
55+
luarocks install dkjson
56+
luarocks upload rockspec/jsonschema-${{ steps.release_env.outputs.version_withou_v }}-0.rockspec --api-key=${LUAROCKS_TOKEN}

rockspec/jsonschema-0.9.6-0.rockspec

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package = "jsonschema"
2+
version = "0.9.6-0"
3+
source = {
4+
url = "git://github.com/api7/jsonschema.git",
5+
tag = "v0.9.6",
6+
}
7+
8+
description = {
9+
summary = "JSON Schema data validator",
10+
detailed = [[
11+
This library provides a jsonschema draft 4, draft 6, draft 7 validator for Lua/LuaJIT.
12+
Given an JSON schema, it will generates a validator function that can be used
13+
to validate any kind of data (not limited to JSON).
14+
15+
Base on https://github.com/jdesgats/jsonschema .
16+
]],
17+
homepage = "https://github.com/api7/jsonschema",
18+
license = "Apache License 2.0",
19+
}
20+
21+
dependencies = {
22+
"net-url",
23+
}
24+
25+
build = {
26+
type = "builtin",
27+
modules = {
28+
["jsonschema"] = "lib/jsonschema.lua",
29+
["jsonschema.store"] = "lib/jsonschema/store.lua",
30+
}
31+
}

0 commit comments

Comments
 (0)