diff --git a/.final b/.final new file mode 100644 index 0000000..c591978 --- /dev/null +++ b/.final @@ -0,0 +1 @@ +complete diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 8cb2f8a..5abb4c6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -2,9 +2,6 @@ name: Benchmarks on: [push, pull_request] -permissions: - contents: read - jobs: benchmark: runs-on: ubuntu-latest @@ -13,10 +10,10 @@ jobs: matrix: node-version: [^18, ^20] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v2.1.5 with: node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ad5aeb..bfdccaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,19 +2,14 @@ name: CI on: [push, pull_request] -permissions: - contents: read - jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: ^20 + uses: actions/setup-node@v2.1.5 - name: Install Dependency run: yarn install @@ -22,17 +17,17 @@ jobs: - name: Run Lint run: yarn run lint + - name: Run Fix + run: yarn run fmt + coverage: needs: [lint] runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v2.1.5 with: node-version: ^20 @@ -46,18 +41,19 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + parallel: true test: needs: [lint] runs-on: ubuntu-latest strategy: matrix: - node: [^20] + node: [^18, ^20] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v2.1.5 with: node-version: ${{ matrix.node }} @@ -67,5 +63,25 @@ jobs: - name: Run Unit test run: yarn run test - - name: Run Build - run: yarn run build + semantic-release: + needs: [lint, test, coverage] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2.1.5 + with: + node-version: ^20 + + - name: Run semantic-release + if: github.repository == 'casbin/casbin-core' && github.event_name == 'push' + run: | + yarn install + yarn run build + yarn run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/platform_test.yml b/.github/workflows/platform_test.yml index c184851..f6ac352 100644 --- a/.github/workflows/platform_test.yml +++ b/.github/workflows/platform_test.yml @@ -2,9 +2,6 @@ name: Platform Test on: [push, pull_request] -permissions: - contents: read - jobs: reactjs: runs-on: ubuntu-latest @@ -13,10 +10,10 @@ jobs: matrix: node-version: [^20] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v2.1.5 with: node-version: ${{ matrix.node-version }} @@ -39,10 +36,10 @@ jobs: matrix: node-version: [^20] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v2.1.5 with: node-version: ${{ matrix.node-version }} @@ -62,10 +59,10 @@ jobs: matrix: node-version: [^20] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v2.1.5 with: node-version: ${{ matrix.node-version }} diff --git a/.husky/commit-msg b/.husky/commit-msg old mode 100755 new mode 100644 diff --git a/README.md b/README.md index fd0811a..5b73396 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ [![Coverage Status](https://coveralls.io/repos/github/casbin/casbin-core/badge.svg?branch=main)](https://coveralls.io/github/casbin/casbin-core?branch=main) [![NPM version][npm-image]][npm-url] [![NPM download][download-image]][download-url] -[![install size](https://packagephobia.now.sh/badge?p=casbin-core)](https://packagephobia.now.sh/result?p=casbin-core) -[![codebeat badge](https://codebeat.co/badges/c17c9ee1-da42-4db3-8047-9574ad2b23b1)](https://codebeat.co/projects/github-com-casbin-casbin-core-main) -[![Release](https://img.shields.io/github/release/casbin/casbin-core.svg)](https://github.com/casbin/casbin-core/releases/latest) [![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN) [npm-image]: https://img.shields.io/npm/v/casbin-core.svg?style=flat-square diff --git a/package.json b/package.json index 1161584..68f3d87 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "commit": "git-cz", "clean": "rimraf lib es dist", "coverage": "jest --coverage", - "prepare": "husky install" + "prepare": "husky install", + "release": "semantic-release" }, "devDependencies": { "@commitlint/cli": "^16.3.0",