|
10 | 10 | jobs: |
11 | 11 | build: |
12 | 12 | runs-on: ubuntu-latest |
13 | | - env: |
14 | | - NODE_ENV: production |
15 | 13 |
|
16 | 14 | steps: |
17 | 15 | - name: Checking out for ${{ github.ref }} |
|
24 | 22 |
|
25 | 23 | - run: npm run bootstrap |
26 | 24 | - run: npm run build |
| 25 | + env: |
| 26 | + NODE_ENV: production |
27 | 27 |
|
28 | 28 | - name: Run npm pack api |
29 | 29 | run: | |
@@ -65,30 +65,59 @@ jobs: |
65 | 65 | name: bundle |
66 | 66 | path: packages/bundle/dist/**/* |
67 | 67 |
|
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 | | - |
81 | 68 | - id: compute-hash |
82 | 69 | name: Compute build metadata |
83 | 70 | 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" |
84 | 74 | echo "::set-output name=sha384-es5::`cat packages/bundle/dist/webchat-es5.js | openssl dgst -sha384 -binary | openssl base64 -A`" |
85 | 75 | echo "::set-output name=sha384-full::`cat packages/bundle/dist/webchat.js | openssl dgst -sha384 -binary | openssl base64 -A`" |
86 | 76 | 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'`" |
88 | 77 |
|
89 | 78 | - name: Display build metadata |
90 | 79 | 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 }} |
91 | 83 | echo sha384-es5=${{ steps.compute-hash.outputs.sha384-es5 }} |
92 | 84 | echo sha384-full=${{ steps.compute-hash.outputs.sha384-full }} |
93 | 85 | 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