diff --git a/.github/workflows/gh-publish.yml b/.github/workflows/gh-publish.yml new file mode 100644 index 0000000..1b4eea4 --- /dev/null +++ b/.github/workflows/gh-publish.yml @@ -0,0 +1,36 @@ +name: Publish Package GitHub Registry +on: + release: + types: + - published +jobs: + publish-npm: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + + - name: Setup Node for GitHub Packages + uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://npm.pkg.github.com' + + - name: Install Dependencies + run: bun install --frozen-lockfile + + - name: Test Package + run: bun test + + - name: Build Package + run: bun run build + + - name: Release to GitHub Packages + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/npm-publish.yml similarity index 83% rename from .github/workflows/publish.yml rename to .github/workflows/npm-publish.yml index 92a9b47..6865b35 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,4 +1,4 @@ -name: Publish Package to NPM and GitHub Registry +name: Publish Package to NPM Registry on: release: types: @@ -29,9 +29,6 @@ jobs: - name: Build Package run: bun run build - - - name: Format package.json - run: bun prettier ./package.json --write - name: Release run: npm publish --access public