Skip to content

Commit 3bad15d

Browse files
committed
Add release
1 parent 7af7984 commit 3bad15d

1 file changed

Lines changed: 46 additions & 17 deletions

File tree

.github/workflows/daily-release.yaml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13-
env:
14-
NODE_ENV: production
1513

1614
steps:
1715
- name: Checking out for ${{ github.ref }}
@@ -24,6 +22,8 @@ jobs:
2422

2523
- run: npm run bootstrap
2624
- run: npm run build
25+
env:
26+
NODE_ENV: production
2727

2828
- name: Run npm pack api
2929
run: |
@@ -65,30 +65,59 @@ jobs:
6565
name: bundle
6666
path: packages/bundle/dist/**/*
6767

68-
# - id: deploy
69-
# uses: azure/webapps-deploy@v2.1.2
70-
# with:
71-
# app-name: webchat-playground
72-
# slot-name: production
73-
# publish-profile: ${{ secrets.PLAYGROUND_PUBLISH_PROFILE }}
74-
# package: packages/playground/build.zip
75-
76-
# - name: Ping deployment
77-
# run: |
78-
# sleep 15
79-
# curl -s ${{ steps.deploy.outputs.webapp-url }}
80-
8168
- id: compute-hash
8269
name: Compute build metadata
8370
run: |
71+
echo "::set-output name=build-date::`date \"+%Y-%m-%d %R:%S\"`"
72+
echo "::set-output name=package-version::`tar -xOzf packages/bundle/webchat-*.tgz package/package.json | jq -r '.version'`"
73+
echo "::set-output name=release-tag-name::daily"
8474
echo "::set-output name=sha384-es5::`cat packages/bundle/dist/webchat-es5.js | openssl dgst -sha384 -binary | openssl base64 -A`"
8575
echo "::set-output name=sha384-full::`cat packages/bundle/dist/webchat.js | openssl dgst -sha384 -binary | openssl base64 -A`"
8676
echo "::set-output name=sha384-minimal::`cat packages/bundle/dist/webchat-minimal.js | openssl dgst -sha384 -binary | openssl base64 -A`"
87-
echo "::set-output name=package-version::`tar -xOzf packages/bundle/webchat-*.tgz package/package.json | jq -r '.version'`"
8877
8978
- name: Display build metadata
9079
run: |
80+
echo build-date=${{ steps.compute-hash.outputs.build-date }}
81+
echo release-tag-name=${{ steps.compute-hash.outputs.release-tag-name }}
82+
echo package-version=${{ steps.compute-hash.outputs.package-version }}
9183
echo sha384-es5=${{ steps.compute-hash.outputs.sha384-es5 }}
9284
echo sha384-full=${{ steps.compute-hash.outputs.sha384-full }}
9385
echo sha384-minimal=${{ steps.compute-hash.outputs.sha384-minimal }}
94-
echo package-version=${{ steps.compute-hash.outputs.package-version }}
86+
87+
- name: Create release
88+
uses: actions/create-release@v1
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
91+
with:
92+
tag_name: ${{ steps.compute-hash.outputs.release-tag-name }}
93+
release_name: Daily build $GITHUB_REF
94+
body: |
95+
This build will be updated daily. **Please do not use this build in production environment.**
96+
97+
| Build time | Run ID | Source version | Git ref | Package version |
98+
| - | - | - | - | - |
99+
| ${{ steps.compute-hash.outputs.build-date }} | [`$GITHUB_RUN_ID`](${{ $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID }}) | [$GITHUB_SHA]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commit/$GITHUB_SHA) | `$GITHUB_REF` | `${{ steps.compute-hash.outputs.package-version }}` |
100+
101+
```html
102+
<script
103+
crossorigin="anonymous"
104+
integrity="sha384-${{ steps.compute-hash.outputs.sha384-full }}"
105+
src="https://github.com/microsoft/BotFramework-WebChat/releases/download/${{ steps.compute-hash.outputs.release-tag-name }}/webchat.js"
106+
></script>
107+
108+
<script
109+
crossorigin="anonymous"
110+
integrity="sha384-${{ steps.compute-hash.outputs.sha384-es5 }}"
111+
src="https://github.com/microsoft/BotFramework-WebChat/releases/download/${{ steps.compute-hash.outputs.release-tag-name }}/webchat-es5.js"
112+
></script>
113+
114+
<script
115+
crossorigin="anonymous"
116+
integrity="sha384-${{ steps.compute-hash.outputs.sha384-minimal }}"
117+
src="https://github.com/microsoft/BotFramework-WebChat/releases/download/${{ steps.compute-hash.outputs.release-tag-name }}/webchat-minimal.js"
118+
></script>
119+
```
120+
121+
> Note: the SHA384 hash may change daily.
122+
draft: false
123+
prerelease: true

0 commit comments

Comments
 (0)