Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisjiang committed May 14, 2024
1 parent 7ab64ba commit 356b8ca
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 35 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/jsr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,41 @@ on:
- main

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
uses: actions/setup-node@v4
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
node-version: latest
- run: npm install pnpm -g
- run: pnpm install

- name: Run test cases
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: npm ci
- run: npm test
- run: pnpm test

publish-jsr:
needs: build
needs: test
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
- uses: npm ci
# - run: npx jsr publish
- name: Checkout
uses: actions/checkout@v4

- name: Publish JSR
uses: actions/setup-node@v4
with:
node-version: latest
- run: npm install jsr -g
# TODO
# - run: jsr publish
36 changes: 24 additions & 12 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,44 @@ on:
types: [created]

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
uses: actions/setup-node@v4
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
node-version: latest
- run: npm install pnpm -g
- run: pnpm install

- name: Run test cases
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: npm ci
- run: npm test
- run: pnpm test

publish-gpr:
needs: build
needs: test
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4

- name: Publish Github package
uses: actions/setup-node@v4
with:
node-version: 20
node-version: latest
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm install pnpm -g
- run: pnpm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 22 additions & 12 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,39 @@ on:
types: [created]

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
uses: actions/setup-node@v4
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
node-version: latest
- run: npm install pnpm -g
- run: pnpm install

- name: Run test cases
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: npm ci
- run: npm test
- run: pnpm test

publish-npm:
needs: build
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4

- name: Publish npm package
uses: actions/setup-node@v4
with:
node-version: 20
node-version: latest
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm install pnpm -g
- run: pnpm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit 356b8ca

Please sign in to comment.