diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c5483a8..2ac0fdc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,5 +1,3 @@ -# Reusable workflow for PRs; to eject, you can replace this file with -# https://github.com/ryansonshine/ryansonshine/blob/main/.github/workflows/pr.yml name: Pull Request on: [pull_request] @@ -9,19 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 with: - fetch-depth: 0 - - name: Setup Node.js Environment - uses: actions/setup-node@v3 - with: - node-version: lts/* - - name: Install Dependencies - run: npm i - - name: Build Project - run: npm run build - - name: Run Test Suite - run: npm run test + bun-version: latest + - run: bun i + - run: bun run build + - run: bun run test - name: Upload Code Coverage uses: codecov/codecov-action@v3.1.0 diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index eb598a8..f86a3c6 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -1,5 +1,6 @@ name: Release +# Trigger the workflow on pushes to the main branch, as well as workflow calls on: push: branches: @@ -9,32 +10,38 @@ on: NPM_TOKEN: required: true -permissions: - contents: write - jobs: release: name: Release to NPM runs-on: ubuntu-latest + steps: - name: Checkout Repository uses: actions/checkout@v3 with: + # Perform a full git history checkout to enable semantic-release analysis fetch-depth: 0 - - name: Setup Node.js Environment - uses: actions/setup-node@v3 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 with: - node-version: lts/* + bun-version: 'latest' + - name: Install Dependencies - run: npm i + run: bun install + # Use Bun to install dependencies faster + - name: Build Project - run: npm run build - - name: Run Test Suite - run: npm run test - - name: Semantic Release + run: bun run build + + - name: Run Tests + run: bun run test + + - name: Release to NPM env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release + run: bun x semantic-release + - name: Upload Code Coverage uses: codecov/codecov-action@v3.1.0 diff --git a/package.json b/package.json index 9805583..c72ddb9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "files": [ "lib/**/*" ], - "scripts": { + "scripts": { "build": "tsc --project tsconfig.build.json", "clean": "rm -rf ./lib/", "cm": "cz",