-
Notifications
You must be signed in to change notification settings - Fork 1.3k
72 lines (70 loc) · 2.33 KB
/
publish-calendar.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
name: Publish calendar
on: [workflow_dispatch]
env:
WORKING_DIRECTORY: ./apps/calendar
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Check the package version
id: cpv
uses: PostHog/check-package-version@v2
with:
path: ${{ env.WORKING_DIRECTORY }}
- name: Log when unchanged
if: steps.cpv.outputs.is-new-version == 'false'
run: 'echo "No version change"'
- name: Cancel workflow
if: steps.cpv.outputs.is-new-version == 'false'
uses: andymckay/[email protected]
publish-npm:
needs: check-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/composite-actions/install-dependencies
- name: Build calendar
run: |
npm run build:calendar
- name: Check package version
id: cpv
uses: PostHog/check-package-version@v2
with:
path: ${{ env.WORKING_DIRECTORY }}
- name: Create new version tag
run: |
git tag calendar@${{ steps.cpv.outputs.committed-version }}
- name: Push new version tag
run: |
git push origin calendar@${{ steps.cpv.outputs.committed-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update the relative links in README
run: |
PACKAGES=core npm run update:readme
- name: Publish the package to npm (Calendar)
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-cdn:
needs: publish-npm
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- uses: ./.github/composite-actions/install-dependencies
- name: Upload files to CDN
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run build
npm run publish:cdn
env:
TOAST_CLOUD_TENANTID: ${{ secrets.TOAST_CLOUD_TENANTID }}
TOAST_CLOUD_STORAGEID: ${{ secrets.TOAST_CLOUD_STORAGEID }}
TOAST_CLOUD_USERNAME: ${{ secrets.TOAST_CLOUD_USERNAME }}
TOAST_CLOUD_PASSWORD: ${{ secrets.TOAST_CLOUD_PASSWORD }}