From 01f69e4b491345aedc45a19a3c5c56826867e712 Mon Sep 17 00:00:00 2001 From: gitdog01 Date: Wed, 22 Nov 2023 20:25:24 +0900 Subject: [PATCH] workflow updated --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c58dd0e..34055d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,30 @@ -name: Create Release +name: Update NPM and Create Release on: push: - tags: - - 'v*' + branches: [main] + workflow_dispatch: jobs: - release: + update-and-release: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm install + + - name: Bump version + run: npm version minor -m "Bump version to %s" + + - name: Push tags + run: git push --follow-tags - name: Create Release uses: actions/create-release@v1 @@ -22,3 +36,8 @@ jobs: body: Auto-generated release from GitHub Actions. draft: false prerelease: false + + - name: Publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}