Skip to content

Commit

Permalink
Update workflows and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
RajVarsani committed Dec 23, 2023
1 parent c159d01 commit 52f4589
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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/[email protected]
31 changes: 19 additions & 12 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Release

# Trigger the workflow on pushes to the main branch, as well as workflow calls
on:
push:
branches:
Expand All @@ -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/[email protected]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"files": [
"lib/**/*"
],
"scripts": {
"scripts": {
"build": "tsc --project tsconfig.build.json",
"clean": "rm -rf ./lib/",
"cm": "cz",
Expand Down

0 comments on commit 52f4589

Please sign in to comment.