diff --git a/.github/workflows/build_prepare.yaml b/.github/workflows/build_prepare.yaml index 926075c..a8c8baf 100644 --- a/.github/workflows/build_prepare.yaml +++ b/.github/workflows/build_prepare.yaml @@ -117,6 +117,7 @@ jobs: - name: "[Nightly] Write summary" if: inputs.nightly run: | + WEBAPP_VERSION=$(./scripts/get-version.ts) WEB_VERSION=${WEBAPP_VERSION:0:12} REACT_VERSION=${WEBAPP_VERSION:19:12} JS_VERSION=${WEBAPP_VERSION:35:12} @@ -132,8 +133,6 @@ jobs: echo "| Element Web | [$WEB_VERSION](https://github.com/vector-im/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY echo "| React SDK | [$REACT_VERSION](https://github.com/matrix-org/matrix-react-sdk/commit/$REACT_VERSION) |" >> $GITHUB_STEP_SUMMARY echo "| JS SDK | [$JS_VERSION](https://github.com/matrix-org/matrix-js-sdk/commit/$JS_VERSION) |" >> $GITHUB_STEP_SUMMARY - env: - WEBAPP_VERSION: ${{ steps.package.outputs.version }} - uses: actions/upload-artifact@v3 with: diff --git a/scripts/get-version.ts b/scripts/get-version.ts new file mode 100755 index 0000000..fb6f468 --- /dev/null +++ b/scripts/get-version.ts @@ -0,0 +1,25 @@ +#!/usr/bin/env -S npx ts-node + +/* + * Checks for the presence of a webapp, inspects its version and prints it + */ + +import { versionFromAsar } from "./set-version"; + +async function main(): Promise { + const version = await versionFromAsar(); + console.log(version); + + return 0; +} + +if (require.main === module) { + main() + .then((ret) => { + process.exit(ret); + }) + .catch((e) => { + console.error(e); + process.exit(1); + }); +}