Bump #3
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 | |
- name: Compile the assets | |
run: bun compile | |
- name: Run tests | |
run: | | |
bun examples/basic.ts | |
bun examples/oop.ts | |
- run: npm install | |
- name: Replace version in package.json | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/g" package.json | |
- run: npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Push version changes to GitHub | |
run: | | |
git add . | |
git commit -m "chore: update " | |
git push |