Skip to content

Commit

Permalink
feat: add github packages action (#10)
Browse files Browse the repository at this point in the history
* refractor: rename action

* feat: add github packages release action

* refractor: remove unnecessary step in action

---------

Signed-off-by: Fabio Nettis <[email protected]>
  • Loading branch information
fabio-nettis authored Mar 28, 2024
1 parent f72087d commit 36fb2d4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/gh-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package to NPM and GitHub Registry
name: Publish Package to NPM Registry
on:
release:
types:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 36fb2d4

Please sign in to comment.