-
Notifications
You must be signed in to change notification settings - Fork 13
114 lines (114 loc) · 4.43 KB
/
build.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
name: build
on:
workflow_call:
secrets:
NPM_TOKEN:
description: 'NPM token to use to publish packages'
required: false
inputs:
version:
description: 'Version number (x.y.z) to set before executing the build'
type: string
default: ''
docPublish:
description: 'Whether to publish the documentation on gh-pages'
type: boolean
default: false
docPath:
description: 'If version is empty, path in which the documentation on gh-pages should be published.'
type: string
default: ''
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run syncpack:check
- run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- if: inputs.version != ''
run: |
npm run -w demo update:stackblitzPkgs
node scripts/setVersion.js "${{ inputs.version }}"
npm run syncpack:check
- run: npm run build:ci
- run: npm run check
- run: npm run format:check
- run: npm run lint -- --quiet
- name: check stackblitz angular bootstrap lockfile
run: npm ci --dry-run
working-directory: demo/src/lib/stackblitz/angular-bootstrap
- name: check stackblitz angular daisyui lockfile
run: npm ci --dry-run
working-directory: demo/src/lib/stackblitz/angular-daisyui
- name: check stackblitz react bootstrap lockfile
run: npm ci --dry-run
working-directory: demo/src/lib/stackblitz/react-bootstrap
- name: check stackblitz react daisyui lockfile
run: npm ci --dry-run
working-directory: demo/src/lib/stackblitz/react-daisyui
- name: check stackblitz svelte bootstrap lockfile
run: npm ci --dry-run
working-directory: demo/src/lib/stackblitz/svelte-bootstrap
- name: check stackblitz svelte daisyui lockfile
run: npm ci --dry-run
working-directory: demo/src/lib/stackblitz/svelte-daisyui
- run: npm run test:coverage
- uses: codecov/codecov-action@v4
with:
files: core/coverage/lcov.info,core-bootstrap/coverage/lcov.info,angular/headless/coverage/lcov.info,svelte/preprocess/coverage/lcov.info
flags: unit
disable_search: true
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
- run: npm run -w verdaccio verdaccio-publish
- if: inputs.version != ''
run: |
npm whoami
export PUBLISH_TAG="$(node ./scripts/publishTag.js "${{ inputs.version }}")"
node ./scripts/npmPublish.js --provenance --tag "$PUBLISH_TAG"
npm run -w demo update:stackblitzPkgs ${{ inputs.version }}
npm run build -w demo
git commit -a -m v${{ inputs.version }}
git tag v${{ inputs.version }}
git show HEAD
if [[ "$PUBLISH_TAG" == "next" ]]; then
git push origin v${{ inputs.version }}
else
export RELEASE_BRANCH=release/$(node scripts/versionDocFolder.js ${{ inputs.version }})
git checkout -B $RELEASE_BRANCH
git push origin v${{ inputs.version }} $RELEASE_BRANCH
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: inputs.docPublish && (inputs.version != '' || inputs.docPath != '')
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- if: inputs.docPublish && (inputs.version != '' || inputs.docPath != '')
env:
VERSION: ${{ inputs.version }}
working-directory: gh-pages
run: |
if [ -n "$VERSION" ]; then
export DOC_PATH="v$(node ../scripts/versionDocFolder.js "$VERSION")"
else
export DOC_PATH="$(node ../scripts/versionReleaseDocFolder.js "${{ inputs.docPath }}")"
fi
rm -rf "$DOC_PATH"
cp -a ../demo/dist "$DOC_PATH"
node ../scripts/updateVersionsList.js
git add .
git commit --allow-empty -a -m "$DOC_PATH from ${{ github.sha }}"
git push origin gh-pages