From f890739d1bfcd5a7a8e1af4869908428806c152b Mon Sep 17 00:00:00 2001 From: KeisukeYamashita <19yamashita15@gmail.com> Date: Thu, 13 Apr 2023 17:34:50 +0900 Subject: [PATCH] Trigger release workflow on `tag` push (#25) feat: release workflow Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com> --- .github/workflows/publish.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 125ab9f..26d5c96 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,13 @@ -name: Publish package to GitHub Packages +name: Release on: - release: - types: [created] + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + concurrency: group: ${{ github.workflow }} cancel-in-progress: true + jobs: publish: environment: Release @@ -14,6 +17,7 @@ jobs: packages: write steps: - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: ~/.npm @@ -22,17 +26,23 @@ jobs: ${{ runner.os }}-build-node- ${{ runner.os }}-build- ${{ runner.os }}- + - uses: actions/setup-node@v3 with: node-version: 16.x registry-url: https://registry.npmjs.org + - run: npm i + - run: npm run build # Clean up + - run: rm -r node_modules + - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: ncipollo/release-action@v1 with: generateReleaseNotes: true