generated from ryansonshine/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.08 KB
/
release-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release
# Trigger the workflow on pushes to the main branch, as well as workflow calls
on:
push:
branches:
- main
workflow_call:
secrets:
NPM_TOKEN:
required: true
permissions:
contents: write
packages: 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 Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 'latest'
- name: Install Dependencies
run: bun install
# Use Bun to install dependencies faster
- name: Build Project
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: bun x semantic-release
- name: Upload Code Coverage
uses: codecov/[email protected]