Skip to content

Commit 119bf95

Browse files
authored
Add local-build
1 parent 27357b8 commit 119bf95

File tree

3 files changed

+233
-126
lines changed

3 files changed

+233
-126
lines changed

.github/actions/azdo-build/action.yml

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: 'Build via AzDO'
22
description: Run a build pipeline via Azure DevOps and download the build artifact
33

44
inputs:
5-
artifact-name:
6-
description: Output artifact name
7-
default: azdo-artifact
8-
type: string
9-
105
azdo-org:
116
description: AzDO org URL
127
required: true
@@ -37,11 +32,6 @@ inputs:
3732
required: true
3833
type: string
3934

40-
download-artifact-name:
41-
description: Name of AzDO artifact to download
42-
required: true
43-
type: string
44-
4535
pipeline-variable:
4636
description: Pipeline variable (multiline)
4737
required: true
@@ -209,11 +199,11 @@ runs:
209199
echo "Artifact downloaded successfully"
210200
shell: bash
211201

212-
- name: Upload artifact
213-
uses: actions/upload-artifact@v6
214-
with:
215-
name: ${{ inputs.artifact-name }}
216-
path: ./artifact-download/
202+
# - name: Upload artifact
203+
# uses: actions/upload-artifact@v6
204+
# with:
205+
# name: ${{ inputs.artifact-name }}
206+
# path: ./artifact-download/
217207

218208
- id: get-version
219209
name: Get version
@@ -225,3 +215,63 @@ runs:
225215
if [[ "$VERSION" == *-* ]]; then echo version-type=prerelease | tee --append $GITHUB_OUTPUT; else echo version-type=production | tee --append $GITHUB_OUTPUT; fi
226216
shell: bash
227217
working-directory: ./artifact-download/tgzfiles
218+
219+
- name: Extract artifact (bundle)
220+
run: |
221+
mkdir -p ./bundle/
222+
cd ./bundle/
223+
224+
tar \
225+
--extract \
226+
--file=../tgzfiles/botframework-webchat-${{ steps.azdo-build.outputs.version }}.tgz \
227+
--strip-component=1 \
228+
package/dist/ \
229+
package/static/
230+
231+
- name: Extract artifact (fluent-theme)
232+
run: |
233+
mkdir -p ./fluent-theme/
234+
cd ./fluent-theme/
235+
236+
tar \
237+
--extract \
238+
--file=../tgzfiles/botframework-webchat-fluent-theme-${{ steps.azdo-build.outputs.version }}.tgz \
239+
--strip-component=1 \
240+
package/dist/ \
241+
package/static/
242+
243+
- name: Upload artifact (tarball)
244+
uses: actions/upload-artifact@v7
245+
with:
246+
name: tarball
247+
path: ./tgzfiles/*.tgz
248+
249+
- name: Upload artifact (bundle-iife)
250+
uses: actions/upload-artifact@v7
251+
with:
252+
name: bundle-iife
253+
path: ./bundle/dist/webchat*.js
254+
255+
- name: Upload artifact (bundle-esm)
256+
uses: actions/upload-artifact@v7
257+
with:
258+
name: bundle-esm
259+
path: ./bundle/static/
260+
261+
- name: Upload artifact (fluent-theme-iife)
262+
uses: actions/upload-artifact@v7
263+
with:
264+
name: fluent-theme-iife
265+
path: ./fluent-theme/dist/
266+
267+
- name: Upload artifact (fluent-theme-esm)
268+
uses: actions/upload-artifact@v7
269+
with:
270+
name: fluent-theme-esm
271+
path: ./fluent-theme/static/
272+
273+
- name: Upload artifact (sbom)
274+
uses: actions/upload-artifact@v7
275+
with:
276+
name: sbom
277+
path: ./_manifest/spdx_2.2/manifest.spdx.json
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: 'Build via AzDO'
2+
description: Run a build pipeline via Azure DevOps and download the build artifact
3+
4+
inputs: {}
5+
6+
outputs:
7+
version:
8+
description: Version
9+
value: ${{ steps.get-version.outputs.version }}
10+
11+
version-type:
12+
description: Version
13+
value: ${{ steps.get-version.outputs.version-type }}
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- uses: actions/setup-node@v6
19+
with:
20+
node-version: ${{ env.node-version }}
21+
22+
- run: npm clean-install
23+
24+
- name: npm version ${{ needs.prepare.outputs.version }}
25+
run: |
26+
npm version ${{ needs.prepare.outputs.version }} \
27+
--include-workspace-root \
28+
--no-git-tag-version \
29+
--no-workspaces-update \
30+
--workspaces
31+
32+
- env:
33+
NODE_ENV: production
34+
run: npm run build
35+
36+
- name: Pack as tarball
37+
run: |
38+
npm pack \
39+
--workspace=./packages/core \
40+
--workspace=./packages/api \
41+
--workspace=./packages/component \
42+
--workspace=./packages/bundle \
43+
--workspace=./packages/fluent-theme
44+
45+
# - name: Generate SBOM
46+
# # --workspace has no effect, the resulting SBOM still contains other packages in the workspace
47+
# run: npm sbom --package-lock-only --sbom-format spdx --sbom-type library | tee ./sbom.spdx.json
48+
49+
- uses: actions/upload-artifact@v7
50+
with:
51+
name: tarball
52+
path: ./*.tgz
53+
54+
- uses: actions/upload-artifact@v7
55+
with:
56+
name: bundle-iife
57+
path: ./packages/bundle/dist/webchat*.js
58+
59+
- uses: actions/upload-artifact@v7
60+
with:
61+
name: bundle-esm
62+
path: ./packages/bundle/static/
63+
64+
- uses: actions/upload-artifact@v7
65+
with:
66+
name: fluent-theme-iife
67+
path: ./packages/fluent-theme/dist/
68+
69+
- uses: actions/upload-artifact@v7
70+
with:
71+
name: fluent-theme-esm
72+
path: ./packages/fluent-theme/static/
73+
74+
# - name: Upload SBOM artifact
75+
# uses: actions/upload-artifact@v7
76+
# with:
77+
# name: sbom
78+
# path: ./sbom.spdx.json
79+
80+
- id: get-version
81+
name: Get version
82+
run: |
83+
VERSION=$(tar -xzOf botframework-webchat-core-*.tgz package/package.json | jq -r '.version')
84+
85+
echo version=$VERSION | tee --append $GITHUB_OUTPUT
86+
87+
if [[ "$VERSION" == *-* ]]; then echo version-type=prerelease | tee --append $GITHUB_OUTPUT; else echo version-type=production | tee --append $GITHUB_OUTPUT; fi
88+
shell: bash

0 commit comments

Comments
 (0)