From c05948d6345ec01914cd0699b05983892ad4b30b Mon Sep 17 00:00:00 2001 From: Aaron Croissette Date: Tue, 5 Mar 2024 10:13:15 -0500 Subject: [PATCH] feat: release workflow --- .github/workflows/ci.yml | 2 +- .github/workflows/publish-npm.yml | 32 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-npm.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cbf815..2fc33ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - id: install-deps name: Install dependencies run: | - bun install + bun install --frozen-lockfile - id: test name: Run tests run: | diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..9f1347c --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,32 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - id: setup-bun + name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - id: install-deps + name: Install dependencies + run: | + bun install --frozen-lockfile + - id: build + name: Build library + run: | + bun run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file