bump #7
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: CD | |
on: | |
push: | |
tags: ["*"] | |
jobs: | |
push: | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun- | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Compile the assets | |
run: bun compile | |
- name: Run tests | |
run: | | |
bun examples/basic.ts | |
bun examples/oop.ts | |
- id: current-version | |
name: Get current version | |
run: echo "CURRENT_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT | |
- name: Set package version | |
run: bunx npm version --no-git-tag-version $CURRENT_VERSION | |
env: | |
CURRENT_VERSION: ${{ steps.current-version.outputs.CURRENT_VERSION }} | |
- name: Publish package | |
run: | | |
echo "//registry.npmjs.org/:_authToken=$AUTH_TOKEN" >> .npmrc | |
bun publish --provenance --access=public | |
env: | |
AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |