-
Notifications
You must be signed in to change notification settings - Fork 1.3k
84 lines (82 loc) · 2.97 KB
/
publish-wrappers.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
name: Publish wrapper
on: [workflow_dispatch]
env:
WORKING_DIRECTORY: ./apps/calendar
REACT_WRAPPER_DIRECTORY: ./apps/react-calendar
VUE_WRAPPER_DIRECTORY: ./apps/vue-calendar
jobs:
publish-wrapper:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Install root dependencies
uses: ./.github/composite-actions/install-dependencies
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: '16.x'
registry-url: https://registry.npmjs.org/
- name: Build core
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run build
- name: Get the package version
id: version
uses: PostHog/check-package-version@v2
with:
path: ${{ env.WORKING_DIRECTORY }}/
- name: Update version of wrappers in package.json
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run update:wrapper
- name: Update lock file of react wrapper
working-directory: ${{ env.REACT_WRAPPER_DIRECTORY }}
run: |
npm install
- name: Build react wrapper
working-directory: ${{ env.REACT_WRAPPER_DIRECTORY }}
run: |
npm run build
- name: Update lock file of Vue wrapper
working-directory: ${{ env.VUE_WRAPPER_DIRECTORY }}
run: |
npm install
- name: Build vue wrapper
working-directory: ${{ env.VUE_WRAPPER_DIRECTORY }}
run: |
npm run build
- name: Commit files
run: |
rm -rf ./apps/react-calendar/package-lock.json
rm -rf ./apps/vue-calendar/package-lock.json
git config --local user.name "lja1018"
git config --local user.email "[email protected]"
git add .
git commit -m "chore: update version of wrappers to v${{ steps.version.outputs.committed-version }}"
- name: Push version update commit
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Push new version tags
run: |
git tag react-calendar@${{ steps.version.outputs.committed-version }}
git tag vue-calendar@${{ steps.version.outputs.committed-version }}
git push origin react-calendar@${{ steps.version.outputs.committed-version }}
git push origin vue-calendar@${{ steps.version.outputs.committed-version }}
- name: Update the relative links in README
run: |
PACKAGES=react,vue npm run update:readme
- name: Publish react wrapper
working-directory: ${{ env.REACT_WRAPPER_DIRECTORY }}
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish vue wrapper
working-directory: ${{ env.VUE_WRAPPER_DIRECTORY }}
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}