name: Build and Release on: push: tags: - 'v*' permissions: contents: write jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: node-version: 22 cache: npm - run: npm ci - run: npm run typecheck - run: npx eslint src/ - run: npx vitest run - run: npm run build - name: Create webui.zip working-directory: dist run: zip -r ../webui.zip . - name: Build release body run: | awk '/^## \[/{c++} c==1' CHANGELOG.md > release_body.md - name: Release uses: softprops/action-gh-release@v3 with: files: webui.zip body_path: release_body.md # Tag-push releases are created as drafts; the `publish` job un-drafts # them only after the build succeeds, so watcher notifications don't # fire on broken builds. draft: true publish: name: Publish release needs: [build] runs-on: ubuntu-latest permissions: contents: write steps: - name: Un-draft release env: GH_TOKEN: ${{ github.token }} run: gh release edit "${{ github.ref_name }}" --draft=false --latest --repo "${{ github.repository }}" cleanup: name: Cleanup failed release needs: [build] if: failure() runs-on: ubuntu-latest permissions: contents: write steps: - name: Delete draft release and tag env: GH_TOKEN: ${{ github.token }} run: gh release delete "${{ github.ref_name }}" --yes --cleanup-tag --repo "${{ github.repository }}" || true