From 29ac19ddf5c60fe63c5d0b3f64ebbccdb96deed1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 7 Oct 2024 22:33:40 +0200 Subject: [PATCH] added workflow step to overwrite names for release testing --- .github/workflows/release.yaml | 8 ++++++++ scripts/overwrite-with-test-name.js | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 scripts/overwrite-with-test-name.js diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2294203..546b458 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -62,6 +62,14 @@ jobs: run: | yarn setup + # This step is only used for testing in the official kangaroo repo + - name: Overwrite Names for release testing + if: ${{ github.repository }} == 'https://github.com/holochain-apps/holochain-kangaroo-electron' + run: | + echo ${{ github.repository }} + echo "overwriting names for release testing" + node ./scripts/overwrite-with-test-name.js + - name: build and upload the app (macOS arm64) if: matrix.platform == 'macos-latest' env: diff --git a/scripts/overwrite-with-test-name.js b/scripts/overwrite-with-test-name.js new file mode 100644 index 0000000..390eb5c --- /dev/null +++ b/scripts/overwrite-with-test-name.js @@ -0,0 +1,21 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/** + * This script is being used to overwrite the default names in the kangaroo.config.ts to test + * releases in the official kangaroo repo + */ + +const path = require("path"); +const fs = require("fs"); + +let kangarooConfigString = fs.readFileSync("kangaroo.config.ts", "utf-8"); +kangarooConfigString = kangarooConfigString.replace( + "org.holochain.kangaroo-electron", + "org.holochain.kangaroo-electron-test" +); + +kangarooConfigString = kangarooConfigString.replace( + "Holochain Kangaroo Electron", + "Holochain Kangaroo Electron (Test)" +); + +fs.writeFileSync('kangaroo.config.ts', kangarooConfigString, 'utf-8');