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" } }