diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dbb7057 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release & Publish to NPM +on: workflow_dispatch +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + - name: Install dependencies + run: npm ci --legacy-peer-deps + - name: Configure Git User + run: | + git config --global user.name "Mustapha GHLISSI" + git config --global user.email "ghlissi.mustapha@gmail.com" + - name: Configure NPM + run: npm config set //registry.npmjs.org/:_authToken $NPM_PUBLISH_TOKEN + env: + NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + - name: Release + run: npm run release --ci + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + - name: End of release + run: echo "Success !" diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..6356763 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +npx --no -- commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit index 72c4429..754fb2e 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,2 @@ -npm test +#!/usr/bin/env sh +npx lint-staged \ No newline at end of file