Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix samples (second round) #5300

Merged
merged 28 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
14ca05d
Move to npm workspaces
compulim Sep 20, 2024
f1a1191
Add npm version
compulim Sep 20, 2024
b3b3428
Disable pipeline
compulim Sep 20, 2024
a7e81ce
Move to workflow_dispatch
compulim Sep 20, 2024
e7ef92b
Update upload/download action version
compulim Sep 20, 2024
8e55cb6
Bump to actions/checkout@v2
compulim Sep 20, 2024
b3d5d9e
Move away from set-output
compulim Sep 20, 2024
3df5127
Update action versions
compulim Sep 20, 2024
4d30173
Bump actions/checkout@v4
compulim Sep 20, 2024
0ee69c5
Fix quote
compulim Sep 20, 2024
f2c6c6b
Downgrade to v3 because cannot merge artifacts
compulim Sep 20, 2024
87e336d
Use v4 and merge artifacts
compulim Sep 20, 2024
b093d18
Use upload-artifact/merge
compulim Sep 20, 2024
1a95f79
No recompress docker.zip
compulim Sep 20, 2024
3a7624b
Set up environment
compulim Sep 20, 2024
1efaa2b
Add workflow_dispatch
compulim Sep 20, 2024
95283ee
Deploy to Pages on all branches
compulim Sep 20, 2024
47a5e67
Redeploy daily
compulim Sep 20, 2024
9005642
Deprecate hybrid React version sample
compulim Sep 20, 2024
066c452
Fix public path
compulim Sep 20, 2024
474b640
Fix upload-pages-artifact
compulim Sep 20, 2024
58973fd
Merge test results
compulim Sep 20, 2024
644fe6b
Update pull-request-validation.yml
compulim Sep 20, 2024
621f35e
Fix xargs
compulim Sep 20, 2024
6b8bd92
Build only on main
compulim Sep 20, 2024
4aa9a55
Remove commented steps
compulim Sep 20, 2024
c5547dd
Run lcov
compulim Sep 20, 2024
059c497
On-demand daily release
compulim Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 34 additions & 28 deletions .github/workflows/daily-release.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
name: Daily release

# For internal on-demand tests, until we can build it in AzDO.

on:
push:
paths:
- .github/workflows/daily-release.yaml
schedule:
- cron: 00 03 * * *
# push:
# paths:
# - .github/workflows/daily-release.yaml
# schedule:
# - cron: 00 03 * * *
workflow_dispatch: {}

defaults:
run:
shell: bash

env:
node-version: 22

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checking out for ${{ github.ref }}
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: npm

- run: npx version-from-git --no-git-tag-version

Expand Down Expand Up @@ -60,13 +76,13 @@ jobs:
cp *.tgz ../../artifacts/tarballs

- name: Upload bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: bundles
path: packages/bundle/dist/**/*

- name: Upload tarballs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: tarballs
path: artifacts/tarballs/**/*
Expand All @@ -76,34 +92,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: bundles

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: tarballs

- id: compute_hash
name: Compute build metadata
run: |
echo "::set-output name=git_short_sha::`echo ${{ github.sha }} | cut -c 1-7`"
echo "::set-output name=package_version::`tar -xOzf botframework-webchat-4*.tgz package/package.json | jq -r '.version'`"
echo "::set-output name=release_date::`date \"+%Y-%m-%d %R:%S\"`"
echo "::set-output name=release_tag_name::daily"
echo "::set-output name=sha384_es5::`cat webchat-es5.js | openssl dgst -sha384 -binary | openssl base64 -A`"
echo "::set-output name=sha384_full::`cat webchat.js | openssl dgst -sha384 -binary | openssl base64 -A`"
echo "::set-output name=sha384_minimal::`cat webchat-minimal.js | openssl dgst -sha384 -binary | openssl base64 -A`"

- name: Display build metadata
run: |
echo git_short_sha=${{ steps.compute_hash.outputs.git_short_sha }}
echo package_version=${{ steps.compute_hash.outputs.package_version }}
echo release_date=${{ steps.compute_hash.outputs.release_date }}
echo release_tag_name=${{ steps.compute_hash.outputs.release_tag_name }}
echo sha384_es5=${{ steps.compute_hash.outputs.sha384_es5 }}
echo sha384_full=${{ steps.compute_hash.outputs.sha384_full }}
echo sha384_minimal=${{ steps.compute_hash.outputs.sha384_minimal }}
echo git_short_sha=`echo ${{ github.sha }} | cut -c 1-7` | tee --append $GITHUB_OUTPUT
echo package_version=`tar -xOzf botframework-webchat-4*.tgz package/package.json | jq -r '.version'` | tee --append $GITHUB_OUTPUT
echo release_date=`date "+%Y-%m-%d %R:%S"` | tee --append $GITHUB_OUTPUT
echo release_tag_name=daily | tee --append $GITHUB_OUTPUT
echo sha384_es5=`cat webchat-es5.js | openssl dgst -sha384 -binary | openssl base64 -A` | tee --append $GITHUB_OUTPUT
echo sha384_full=`cat webchat.js | openssl dgst -sha384 -binary | openssl base64 -A` | tee --append $GITHUB_OUTPUT
echo sha384_minimal=`cat webchat-minimal.js | openssl dgst -sha384 -binary | openssl base64 -A` | tee --append $GITHUB_OUTPUT

- name: Delete existing release
# When this workflow is run in its first time, or 2+ are running side-by-side, the release may not exists. It is okay to ignore 404s.
Expand All @@ -121,7 +127,7 @@ jobs:
tag_name: ${{ steps.compute_hash.outputs.release_tag_name }}
release_name: Daily (${{ github.ref }})
body: |
This release will be updated daily. **Please do not use this build in production environment.**
This release is for internal testing only. **Please do not use this build in production environment.**

| Build time | Run ID | Source version | Git ref | Package version |
| - | - | - | - | - |
Expand Down
82 changes: 41 additions & 41 deletions .github/workflows/publish-github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,37 @@ on:
paths:
- .github/workflows/publish-github-pages.yaml
- samples/**
workflow_dispatch: {}

defaults:
run:
shell: bash

env:
node-version: 22

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checking out for ${{ github.ref }}
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run npm ci --no-production
env:
NODE_ENV: production
run: |
cd samples
npm ci --no-production
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: npm

- name: Run npm run bootstrap
run: |
cd samples
npm run bootstrap
- run: npm clean-install
working-directory: ./samples

- name: Run npm run build
env:
NODE_ENV: production
run: |
cd samples
npm run build
run: npm run build
working-directory: ./samples

- name: Copy files
run: |
Expand All @@ -47,11 +51,7 @@ jobs:
rsync -av --progress samples/00.migration/ gh-pages/00.migration/

mkdir gh-pages/01.getting-started
rsync -av --progress samples/01.getting-started/ gh-pages/01.getting-started/ \
--exclude g.hybrid-react-npm

mkdir gh-pages/01.getting-started/g.hybrid-react-npm
rsync -av --progress samples/01.getting-started/g.hybrid-react-npm/packages/app/build/ gh-pages/01.getting-started/g.hybrid-react-npm/
rsync -av --progress samples/01.getting-started/ gh-pages/01.getting-started/

mkdir gh-pages/02.branding-styling-and-customization
rsync -av --progress samples/02.branding-styling-and-customization/ gh-pages/02.branding-styling-and-customization/
Expand All @@ -67,16 +67,16 @@ jobs:
--exclude h.clear-after-idle

mkdir gh-pages/04.api/e.piping-to-redux
rsync -av --progress samples/04.api/e.piping-to-redux/build/ gh-pages/04.api/e.piping-to-redux/
rsync -av --progress samples/04.api/e.piping-to-redux/public/ gh-pages/04.api/e.piping-to-redux/

mkdir gh-pages/04.api/f.selectable-activity
rsync -av --progress samples/04.api/f.selectable-activity/build/ gh-pages/04.api/f.selectable-activity/
rsync -av --progress samples/04.api/f.selectable-activity/public/ gh-pages/04.api/f.selectable-activity/

mkdir gh-pages/04.api/g.chat-send-history
rsync -av --progress samples/04.api/g.chat-send-history/build/ gh-pages/04.api/g.chat-send-history/
rsync -av --progress samples/04.api/g.chat-send-history/public/ gh-pages/04.api/g.chat-send-history/

mkdir gh-pages/04.api/h.clear-after-idle
rsync -av --progress samples/04.api/h.clear-after-idle/build/ gh-pages/04.api/h.clear-after-idle/
rsync -av --progress samples/04.api/h.clear-after-idle/public/ gh-pages/04.api/h.clear-after-idle/

mkdir gh-pages/05.custom-components
rsync -av --progress samples/05.custom-components/ gh-pages/05.custom-components/
Expand All @@ -89,35 +89,35 @@ jobs:
--exclude d.plain-ui

mkdir gh-pages/06.recomposing-ui/a.minimizable-web-chat
rsync -av --progress samples/06.recomposing-ui/a.minimizable-web-chat/build/ gh-pages/06.recomposing-ui/a.minimizable-web-chat/
rsync -av --progress samples/06.recomposing-ui/a.minimizable-web-chat/public/ gh-pages/06.recomposing-ui/a.minimizable-web-chat/

mkdir gh-pages/06.recomposing-ui/b.speech-ui
rsync -av --progress samples/06.recomposing-ui/b.speech-ui/build/ gh-pages/06.recomposing-ui/b.speech-ui/
rsync -av --progress samples/06.recomposing-ui/b.speech-ui/public/ gh-pages/06.recomposing-ui/b.speech-ui/

mkdir gh-pages/06.recomposing-ui/c.smart-display
rsync -av --progress samples/06.recomposing-ui/c.smart-display/build/ gh-pages/06.recomposing-ui/c.smart-display/
rsync -av --progress samples/06.recomposing-ui/c.smart-display/public/ gh-pages/06.recomposing-ui/c.smart-display/

mkdir gh-pages/06.recomposing-ui/d.plain-ui
rsync -av --progress samples/06.recomposing-ui/d.plain-ui/build/ gh-pages/06.recomposing-ui/d.plain-ui/
rsync -av --progress samples/06.recomposing-ui/d.plain-ui/public/ gh-pages/06.recomposing-ui/d.plain-ui/

- name: Upload bundles
uses: actions/upload-artifact@v2
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: gh-pages
path: gh-pages/**/*
path: gh-pages

release:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
id-token: write
pages: write

needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v2
with:
name: gh-pages
path: ./public

- name: Publish GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
Loading
Loading