generated from ryansonshine/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c159d01
commit 52f4589
Showing
3 changed files
with
26 additions
and
28 deletions.
There are no files selected for viewing
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
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] | ||
|
@@ -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] |
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
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: | ||
|
@@ -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] |
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