Skip to content

Commit

Permalink
create-lua-resty-router
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangnanscu committed Dec 2, 2024
1 parent 1d76091 commit ab48c04
Show file tree
Hide file tree
Showing 32 changed files with 2,262 additions and 82 deletions.
23 changes: 23 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
NODE_ENV=development
VITE_NAME=xodel
VITE_PORT=5173
VITE_HOST=localhost
VITE_HTTPS=off
VITE_HTTPS_DEV=off #used in github codespaces
COOKIE_EXPIRES=300d
# nginx
NGINX_LISTEN=8000
NGINX_SERVER_NAME=localhost
WORKER_CONNECTIONS=1024
LUA_CODE_CACHE=off
LIMIT_REQ_ZONE_NAME=one
LIMIT_REQ_ZONE_SIZE=5m
LIMIT_REQ_ZONE_RATE=5000
LIMIT_REQ_BURST=500
LUA_SHARED_DICT=CODE 10M
ACCESS_LOG_BUFFER=32k
LUA_SSL_TRUSTED_CERTIFICATE=/etc/ssl/certs/ca-certificates.crt
LUA_SSL_VERIFY_DEPTH=2
CLIENT_MAX_BODY_SIZE=10m
CLIENT_BODY_BUFFER_SIZE=10m
DEFAULT_TYPE=`"application/json;charset=utf-8"`
49 changes: 49 additions & 0 deletions .github/workflows/publish-package-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish to GitHub Packages

on:
push:
branches:
- master
paths: "package.json"

jobs:
publish-gpr:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
ssh-key: ${{ secrets.SSH_KEY }}
submodules: true
- name: Configure Git
run: |
git config --global user.email "280145668@qq.com"
git config --global user.name "xiangnanscu-ci"
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: https://npm.pkg.github.com/
- name: Install jq
run: sudo apt-get install jq
- name: Check if version changed
id: version_changed
run: |
VERSION_OLD=$(git show ${{ github.event.before }}:package.json | jq -r .version)
VERSION_NEW=$(jq -r .version package.json)
if [ "$VERSION_OLD" != "$VERSION_NEW" ]; then
echo "Version changed from $VERSION_OLD to $VERSION_NEW"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "Version did not change"
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Publish to github
if: steps.version_changed.outputs.changed == 'true'
run: |
npm i
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
43 changes: 43 additions & 0 deletions .github/workflows/publish-package-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to NPM Packages

on:
push:
branches:
- master
paths: "package.json"

jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: https://registry.npmjs.org/
- name: Install jq
run: sudo apt-get install jq
- name: Check if version changed
id: version_changed
run: |
VERSION_OLD=$(git show ${{ github.event.before }}:package.json | jq -r .version)
VERSION_NEW=$(jq -r .version package.json)
if [ "$VERSION_OLD" != "$VERSION_NEW" ]; then
echo "Version changed from $VERSION_OLD to $VERSION_NEW"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "Version did not change"
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Publish to npm
if: steps.version_changed.outputs.changed == 'true'
run: |
npm i
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist-ssr
coverage
*.local

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo

__pycache__

.npmrc
outfile.cjs
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"${3rd}/busted/library",
"${3rd}/OpenResty/library"
],
"Lua.workspace.ignoreDir": [
"template"
],
"Lua.typeFormat.config": {
"format_line": "false",
"auto_complete_end": "false",
Expand Down
Loading

0 comments on commit ab48c04

Please sign in to comment.