-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.64 KB
/
release.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Release
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --no-save
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: bun run commitlint --from=origin/main --to=HEAD
- name: Validate code formatting
run: |
bun run format
if [[ $(git status --porcelain) ]]; then
echo "Code not properly formatted. Please run 'bun run format' locally and commit changes."
exit 1
fi
- name: Lint & check types
run: bun run check
- name: Test
run: bun test
Release:
needs: [Test]
permissions:
contents: write
issues: write
pull-requests: write
if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run semantic-release