diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3462dbf..032d8bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,3 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - name: CI on: @@ -13,19 +10,19 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x, 20.x, 21.x, 25.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - - uses: actions/checkout@v6 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 with: - node-version: ${{ matrix.node-version }} - cache: "npm" - - run: npm install - - run: npm ci - - run: npm run build --if-present - - run: npm test + # This will always pull the most recent stable version + bun-version: latest + + - name: Install dependencies + # --frozen-lockfile is the Bun equivalent of 'npm ci' + run: bun install --frozen-lockfile + + - name: Test + run: bun test diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8e4b255..32939e5 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,34 +1,29 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages - -name: Node.js Package +name: Bun Package Release on: release: types: [created] jobs: - build: + release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 25 - - run: npm ci - - run: npm test - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v4 + - name: Setup Bun + uses: oven-sh/setup-bun@v2 with: - node-version: 25 - registry-url: https://registry.npmjs.org/ - - run: npm install - - run: npm ci - - run: npm publish + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Run Tests + run: bun test + + - name: Publish to NPM + # --access public is required for scoped packages (@your-org/pkg) + # --tolerate-republish prevents CI failure if the version already exists + run: bun publish --access public --tolerate-republish env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NPM_CONFIG_TOKEN: ${{ secrets.npm_token }}