-
Notifications
You must be signed in to change notification settings - Fork 7
162 lines (133 loc) · 4.32 KB
/
ci.js.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI/CD
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install
run: yarn
- name: Build
run: yarn build
- name: Test
run: yarn test
# - name: Code Coverage Report
# uses: irongut/[email protected]
# with:
# filename: coverage/**/cobertura-coverage.xml
# badge: true
# fail_below_min: true
# format: markdown
# hide_branch_rate: false
# hide_complexity: true
# indicators: true
# output: both
# thresholds: '60 80'
# - name: Add Coverage PR Comment
# uses: marocchino/sticky-pull-request-comment@v2
# if: github.event_name == 'pull_request'
# with:
# recreate: true
# path: code-coverage-results.md
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: lib_core
path: packages/jewishDatesCore/lib
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist_core
path: packages/jewishDatesCore/dist
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: lib_picker
path: packages/reactJewishDatePicker/lib
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist_picker
path: packages/reactJewishDatePicker/dist
release:
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
pull-requests: write
deployments: write
id-token: write
needs: [build-and-test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install
run: yarn
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: lib_core
path: packages/jewishDatesCore/lib
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: dist_core
path: packages/jewishDatesCore/dist
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: lib_picker
path: packages/reactJewishDatePicker/lib
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: dist_picker
path: packages/reactJewishDatePicker/dist
- run: yarn inc-version
- name: Set env $VERSION_TAG
run: echo "VERSION_TAG=$(yarn get-version)" >> $GITHUB_ENV
- run: git tag v$VERSION_TAG
- name: Commit version
run: |
git config --global user.name 'Shmulik-Kravitz'
git config --global user.email '[email protected]'
git commit -am v$VERSION_TAG
git push
git push origin v$VERSION_TAG
# - run: yarn npm publish --access public
# - run: yarn pub
# env:
# YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# we use yarn to pack due to yarn workspaces issue with workspace:* in published package in npm
- name: pack jewish-dates-core
working-directory: packages/jewishDatesCore/
run: yarn pack
- name: pack jewish-dates-core
working-directory: packages/reactJewishDatePicker/
run: yarn pack
- name: npm-publish jewish-dates-core
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: packages/jewishDatesCore/package.tgz
provenance: true
- name: npm-publish react-jewish-datepicker
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: packages/reactJewishDatePicker/package.tgz
provenance: true