-
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (65 loc) · 2.06 KB
/
cicd.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI/CD
on:
push:
branches:
- main
pull_request:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
check:
name: Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup
uses: ./.github/actions/setup
- name: Check
run: pnpm check
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: pnpm build
- name: Upload Artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: dist
path: dist
release:
name: Release
runs-on: ubuntu-latest
needs:
- check
- build
# Only run on main branch and when previous jobs are successful
if: ${{ github.repository == 'kamiazya/vue-highlight' && github.ref == 'refs/heads/main' && success() }}
permissions:
contents: write # Used to commit to "Version Packages" PR
pull-requests: write # Used to create "Version Packages" PR
id-token: write # Used to publish to npm with provenance statements
# Other permissions are defaulted to none
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Setup
uses: ./.github/actions/setup
- name: Download Artifact
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
with:
publish: pnpm changeset publish
version: pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}