Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github packages action #10

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading