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