From ce448792d3003de0706940e9dc4fb3f73990cbf9 Mon Sep 17 00:00:00 2001 From: Mist Date: Mon, 12 Feb 2024 20:19:53 +0800 Subject: [PATCH] [Feat] add commitlint configuration and linting workflow --- .commitlintrc.js | 4 ++++ .github/workflows/lint.yml | 21 +++++++++++++++++++++ .github/workflows/release.yml | 7 +++---- .gitignore | 8 ++++++++ plugin-name/init.lua | 0 project.toml | 2 +- 6 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .commitlintrc.js create mode 100644 .github/workflows/lint.yml delete mode 100644 plugin-name/init.lua diff --git a/.commitlintrc.js b/.commitlintrc.js new file mode 100644 index 0000000..339eaee --- /dev/null +++ b/.commitlintrc.js @@ -0,0 +1,4 @@ +module.exports = { + // This line config will read the NPM package named "commitlint-config-wizardoc", so please make sure you have installed it before config this line. + extends: "wizardoc", +}; diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..e4299b3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint + +on: push + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup nodejs + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: Install commit message convention lib + run: npm i commitlint-config-wizardoc -D + + - name: Check lint name convention + uses: wagoid/commitlint-github-action@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc04596..eac73b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: 'Release' +name: Release on: push: @@ -15,7 +15,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Replace template run: python3 scripts/replace-template.py @@ -23,7 +23,7 @@ jobs: - name: Commit changes uses: EndBug/add-and-commit@v9 with: - message: '[Update] apply template' + message: "[Update] apply template" - name: Read version from project config id: read_toml @@ -45,4 +45,3 @@ jobs: tag: ${{ steps.tag_version.outputs.new_tag }} name: Release ${{ steps.tag_version.outputs.new_tag }} generateReleaseNotes: true - diff --git a/.gitignore b/.gitignore index e69de29..547a6d7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,8 @@ +# Lua +/luarocks +/lua +/lua_modules +/.luarocks + +# OS +.DS_Store \ No newline at end of file diff --git a/plugin-name/init.lua b/plugin-name/init.lua deleted file mode 100644 index e69de29..0000000 diff --git a/project.toml b/project.toml index c0a45ee..db5888c 100644 --- a/project.toml +++ b/project.toml @@ -1,6 +1,6 @@ [project] name = "plugin-name" -version = "0.0.1" +version = "0.0.2" description = "description" author = "Mist" email = "mist.zzh@gmail.com"