Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Sep 2, 2024
1 parent 93405e5 commit aa25c25
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ jobs:
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install
run: bun install --frozen-lockfile

- name: Run CI
run: bun run ci

- name: Publish to NPM package registry
run: npm publish --access=public --tag=latest
- name: Prepare .npmrc for publishing
run: |
echo "@secretkeylabs:registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }}

- name: Publish to NPM package registry
# https://github.com/oven-sh/bun/issues/1976
run: bunx npm@latest publish --access=public --tag=latest
10 changes: 8 additions & 2 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install
run: bun install --frozen-lockfile

- name: Run CI
run: bun run ci
Expand All @@ -38,9 +38,15 @@ jobs:
SHA: ${{ steps.sha.outputs.SHA }}
CURRENT_VERSION: ${{ steps.current-version.outputs.CURRENT_VERSION }}

- name: Prepare .npmrc for publishing
run: |
echo "@secretkeylabs:registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }}

- name: Publish to NPM package registry
# https://github.com/oven-sh/bun/issues/1976
run: bunx npm@latest publish --access=public --tag pr-$PR_NUMBER
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }}
PR_NUMBER: ${{ github.event.number }}

0 comments on commit aa25c25

Please sign in to comment.