on: push: tags: - "v*" jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 16 registry-url: 'https://registry.npmjs.org' - name: Install dependencies and build 🔧 run: npm ci && npm run build - name: Run lint run: npm run lint - name: Run tests run: npm run test - name: Package module run: npm pack - name: Verify tag version is the same as package.json version id: version run: | [ ${GITHUB_REF:11} = $(node -p "require('./package.json').version") ] echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT - name: Upload npm package file uses: actions/upload-artifact@v1 with: name: esptool-js-${{ steps.version.outputs.version }}.tgz path: esptool-js-${{ steps.version.outputs.version }}.tgz - name: Create Release id: create_release uses: actions/create-release@v1.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Espressif ESPTOOL-JS ${{ github.ref }} draft: true body: | ### Release Highlights ### Features & Enhancements ### Bug Fixes - name: Publish package on NPM 📦 run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}