From ca4c4caa9a63765a62b50ba3f52664d26f9de29b Mon Sep 17 00:00:00 2001 From: ali Date: Thu, 29 Dec 2022 06:15:49 +0300 Subject: [PATCH] feat: adding publish yml --- .github/workflows/publish.yml | 18 ++++++++++++++++++ package.json | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7dc24ff --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,18 @@ +name: Publish +on: + push: + tags: + - v*.*.* +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: yarn + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }} diff --git a/package.json b/package.json index b05f912..155017d 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,11 @@ "axios": "1.2.1", "nodemon": "2.0.20", "typescript": "4.9.4" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "tsc", + "start": "nodemon dist", + "postversion": "git push && git push --tags" } }