-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.13 KB
/
ci-cd.yaml
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
name: CI/CD
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build-lint-test:
name: Build, lint, test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- run: pnpm run build
- run: pnpm run lint
- run: pnpm run --if-present test
release-latest:
name: Release latest version
needs: [build-lint-test]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
with:
npm-token: ${{ secrets.NPM_TOKEN }}
- run: pnpm run build
- name: Create release PR or publish to npm
uses: changesets/action@v1
with:
publish: pnpm exec changeset publish
commit: "chore: release"
title: "chore: release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}