-
Notifications
You must be signed in to change notification settings - Fork 71
94 lines (78 loc) · 2.73 KB
/
publish_swatches.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
# Publishes pre-built CSS swatches to the Kendo CDN at:
# https://kendo.cdn.telerik.com/themes/<version>/<theme name>/<swatch name>.css
# https://cdn.kendostatic.com/themes/<version>/<theme name>/<swatch name>.css
name: Publish Swatches to CDN
on:
workflow_dispatch:
inputs:
ref:
description: 'Tag or branch to publish'
required: true
default: 'master'
workflow_run:
workflows:
- "Publish to npm"
types:
- completed
jobs:
publish:
runs-on: 'ubuntu-latest'
if: ${{ github.event.inputs.ref || github.event.workflow_run.conclusion == 'success' }}
permissions:
id-token: write # Required by Akeyless
contents: read
packages: read
steps:
- name: Import Secrets
id: import-secrets
uses: LanceMcCarthy/akeyless-action@v3
with:
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
static-secrets: '{ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN" }'
export-secrets-to-environment: false
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup node
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Use cache for root node_modules
id: cache-root-node_modules
uses: actions/cache@v3
with:
path: node_modules
key: root-node_modules-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('package-lock.json') }}
- name: Install
if: steps.cache-root-node_modules.outputs.cache-hit != 'true'
run: npm ci --no-audit --no-fund
- name: Build swatches
run: |
npm run sass
npm run sass:swatches
- name: Checkout artifact repository
uses: actions/checkout@v4
with:
repository: telerik/themes-cdn
token: ${{ steps.import-secrets.outputs.GH_TOKEN }}
path: themes-cdn
lfs: true
- name: Read version
run: |
echo "VERSION=$(jq -r '.version' lerna.json)" >> $GITHUB_ENV
- name: Install rename
run: |
curl https://raw.githubusercontent.com/ap/rename/0da9faa241093c90a40b15a9ff4b36e9858d4516/rename -o ./rename
- name: Package swatches
run: |
perl ./rename -p -e 's/dist\///' -e "s/packages/themes-cdn\/dist\/${{ env.VERSION }}/" packages/*/dist/*.css
- name: Publish swatches
run: |
git config user.name "kendo-bot"
git config user.email "[email protected]"
git add "./dist/${{ env.VERSION }}"
git commit -m "publish ${{ env.VERSION }}"
git push
working-directory: themes-cdn