-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (43 loc) · 1.37 KB
/
build-and-publish.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
name: Build and Publish
on: push
jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
NPM_DIFUKS_TOKEN: ${{ secrets.NPM_DIFUKS_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
# for yarn version check
- if: github.ref != 'refs/heads/main'
run: |
git fetch --no-tags --depth=1 origin main
git checkout -b main
git checkout ${{ github.head_ref || github.ref_name }}
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Install modules
run: yarn
- name: Build plugin
run: yarn build:plugin
- name: Lint plugin
run: yarn lint:plugin
- name: Check packages versions
if: github.ref != 'refs/heads/main'
run: yarn version check
- name: Apply versions
if: github.ref == 'refs/heads/main'
run: yarn version apply
- name: Publish package
if: github.ref == 'refs/heads/main'
run: yarn workspace ts-overrides-plugin npm publish --tolerate-republish
- uses: stefanzweifel/git-auto-commit-action@v5
if: github.ref == 'refs/heads/main'
with:
commit_message: |
ci: Release packages
[skip ci]