-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 2.41 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Build and Publish
on: push
jobs:
build-and-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/plugin
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 --unshallow origin main
- 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
- name: Lint plugin
run: yarn lint
- 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 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]
- name: Get package version
if: github.ref == 'refs/heads/main'
id: package-version
uses: martinbeentjes/[email protected]
with:
path: packages/plugin
- uses: stefanzweifel/git-auto-commit-action@v5
if: github.ref == 'refs/heads/main'
with:
tagging_message: v${{ steps.package-version.outputs.current-version }}
commit_message: |
ci: Release packages
[skip ci]
- name: Get pull request info
if: github.ref == 'refs/heads/main'
id: pull-request-info
uses: actions-ecosystem/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
id: create-release
if: github.ref == 'refs/heads/main'
with:
skipIfReleaseExists: true
makeLatest: true
name: Release ${{ steps.package-version.outputs.current-version }}
body: ${{ steps.pull-request-info.outputs.body }}
tag: v${{ steps.package-version.outputs.current-version }}