v0.2.2 #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish package | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.x | |
- name: Install Dependencies | |
run: bun install --ignore-scripts --frozen-lockfile | |
- name: Run Code Quality Checks | |
run: bun check:ci | |
- name: Run Tests | |
run: | | |
bun test:node | |
bun test:deno | |
bun test:bun | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: https://registry.npmjs.org/ | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.x | |
- name: Read package.json version | |
id: package-version | |
uses: jaywcjlove/github-action-package@main | |
- name: Publish Release | |
if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish Pre-Release | |
if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }} | |
run: npm publish --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish Beta Release | |
if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }} | |
run: npm publish --tag beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |