diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b5320e..8431fcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: tags: - 'v*' +permissions: + id-token: write + contents: write + jobs: build: name: Build binaries @@ -51,8 +55,6 @@ jobs: name: Create release needs: build runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout code @@ -79,3 +81,33 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish: + name: Publish to npm + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: bun install + + - name: Build for npm + run: bun run build:npm + + - name: Verify npm version + run: npm --version + + - name: Publish + run: npm publish --access public diff --git a/README.md b/README.md index 194b893..eb9832c 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,21 @@ sudo mv dora /usr/local/bin/ # Download dora-windows-x64.exe and add to PATH ``` -### Option 2: Build from Source +### Option 2: Install via npm + +Requires [Bun](https://bun.sh) runtime installed. + +```bash +bun install -g @butttons/dora +``` + +Or run without installing: + +```bash +bunx @butttons/dora +``` + +### Option 3: Build from Source ```bash # Install Bun (if not already installed) diff --git a/docs/src/components/QuickStart.astro b/docs/src/components/QuickStart.astro index e911fd7..b42715c 100644 --- a/docs/src/components/QuickStart.astro +++ b/docs/src/components/QuickStart.astro @@ -1,5 +1,9 @@ --- const platformConfigs = { + npm: { + install: `# Install globally (requires Bun) +bun install -g @butttons/dora`, + }, "macos-arm": { install: `curl -L https://github.com/butttons/dora/releases/latest/download/dora-darwin-arm64 -o dora chmod +x dora @@ -113,10 +117,11 @@ bundle install`, id="platform-select" class="w-full bg-zinc-900 border border-zinc-800 text-zinc-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-blue-500 transition-colors" > - - - - + + + + + @@ -193,7 +198,7 @@ bundle install`, return "windows"; } - return "macos-arm"; + return "npm"; } function updateInstallCommands() { diff --git a/docs/src/pages/docs.astro b/docs/src/pages/docs.astro index d33ed8a..99e71d3 100644 --- a/docs/src/pages/docs.astro +++ b/docs/src/pages/docs.astro @@ -156,7 +156,31 @@ import Layout from "../layouts/Layout.astro";

- Option 2: Build from Source + Option 2: Install via npm +

+

+ Requires Bun runtime installed. +

+
+
# Install globally
+
+ bun install -g @butttons/dora +
+
# Or run without installing
+
+ bunx @butttons/dora +
+
+ +

+ Option 3: Build from Source