diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2a4766d..a528573 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,33 +1,58 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages - -name: Node.js Package +name: Release and Publish on: - release: - types: [created] + push: + tags: + - 'v*' jobs: - build: + release: runs-on: ubuntu-latest + permissions: + contents: write + packages: write + id-token: write steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm ci - - run: npm test - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish + node-version: '20' + + - name: Install dependencies + run: npm ci + + - name: Install Playwright + run: npx playwright install webkit + + - name: Build + run: npm run build + + - name: Run checks + run: npm run check + + # Create GitHub Release + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + + # Publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + + - name: Publish to npm + run: npm publish --provenance --access public + + # Publish to GitHub Packages + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://npm.pkg.github.com' + + - name: Publish to GitHub Packages + run: npm publish env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 2669fa8..cc3fe1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aladac/claude-browse", - "version": "0.1.0", + "version": "0.1.1", "description": "Headless browser automation for Claude Code using Playwright WebKit", "type": "module", "main": "dist/index.js",