From 591db95bb6f8566046592de47511df9cdb628735 Mon Sep 17 00:00:00 2001 From: Sachsenspielt Date: Tue, 2 Jan 2024 13:39:06 +0100 Subject: [PATCH] ci: added automated npm release --- .github/workflows/npm.yml | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..df80a2d --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,50 @@ +name: Build and Release + +on: + release: + types: + - published + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm ci + + - name: Build app + run: npm run build + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: build + path: . + + release: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: build + path: . + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLSH_KEY}}