forked from smeup/ketchup
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (127 loc) · 5.23 KB
/
continuum.yaml
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
name: continuum
on:
push:
branches:
- develop
env:
VERSION: 11.0.0-SNAPSHOT
AWS_REGION: eu-south-1
jobs:
ketchup-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.16.0'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Run Ketchup build
run: npm run k:build
- name: Run Ketchup Showcase build
run: npm run ksc:build
- name: Zip artifacts
run: |
cd packages/ketchup/dist
zip -qr /tmp/ketchup.zip *
zip -qr /tmp/ketchup-components.zip ketchup/*
- name: Setup AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Upload artifacts to AWS S3
run: |
aws s3 cp /tmp/ketchup.zip s3://smeup-ketchup/npm-pub/ketchup-stencil/${{ env.VERSION }}/zip/ketchup.zip
aws s3 cp /tmp/ketchup-components.zip s3://smeup-ketchup/npm-pub/ketchup-stencil/${{ env.VERSION }}/zip/ketchup-components.zip
# Prepare GitHub Pages Showcase deployment
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: './packages/ketchup-showcase/dist'
# Showcase Deployment Job
showcase-release:
needs: ketchup-release
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
build:
runs-on: ubuntu-latest
needs: ketchup-release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install --no-immutable
- name: Update Ketchup Version with Timestamp
run: |
cd packages/ketchup
VERSION=$(node -p "require('./package.json').version")
TIMESTAMP=$(date +%Y%m%d%H%M%S)
NEW_VERSION="${VERSION}-${TIMESTAMP}"
echo "New version: $NEW_VERSION"
sed -i "s/\"version\": \"$VERSION\"/\"version\": \"$NEW_VERSION\"/" ./package.json
- name: Update Ketchup React Version with Timestamp
run: |
cd packages/ketchup-react
VERSION=$(node -p "require('./package.json').version")
TIMESTAMP=$(date +%Y%m%d%H%M%S)
NEW_VERSION="${VERSION}-${TIMESTAMP}"
echo "New version: $NEW_VERSION"
sed -i "s/\"version\": \"$VERSION\"/\"version\": \"$NEW_VERSION\"/" ./package.json
- name: Run Ketchup build
run: npm run k:build
- name: Publish Ketchup
run: |
cd packages/ketchup
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Ketchup React
run: |
cd packages/ketchup-react
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
trigger-webup-continuum:
needs: build
runs-on: ubuntu-latest
steps:
- run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.ROBBY_SMEUP_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/smeup/webup-project/actions/workflows/continuum.yaml/dispatches \
-d '{"ref": "develop"}'
trigger-webupjs-develop:
needs: build
runs-on: ubuntu-latest
steps:
- run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.ROBBY_SMEUP_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/smeup/webup.js/actions/workflows/develop-release.yaml/dispatches \
-d '{"ref": "develop"}'