Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline Ensu Tauri CI config

Manav Rathi53c0d7fe0a51
diff --git a/.github/workflows/ensu-build.yml b/.github/workflows/ensu-build.yml
index 8c4303be79..e0d74e3a6f 100644
--- a/.github/workflows/ensu-build.yml
+++ b/.github/workflows/ensu-build.yml
@@ -159,10 +159,30 @@ jobs:
working-directory: rust/apps/ensu
run: yarn install --frozen-lockfile
+ - name: Write Tauri config override
+ shell: bash
+ env:
+ ENSU_TAURI_UPDATER_PUBKEY: ${{ vars.ENSU_TAURI_UPDATER_PUBKEY }}
+ run: |
+ set -euo pipefail
+ : "${ENSU_TAURI_UPDATER_PUBKEY:?}"
+
+ cat > rust/apps/ensu/tauri.ci.conf.json <<EOF
+ {
+ "tauri": {
+ "updater": {
+ "active": true,
+ "pubkey": "${ENSU_TAURI_UPDATER_PUBKEY}"
+ }
+ }
+ }
+ EOF
+
- name: Prepare Windows signing
if: matrix.platform.os == 'windows-latest'
shell: bash
env:
+ ENSU_TAURI_UPDATER_PUBKEY: ${{ vars.ENSU_TAURI_UPDATER_PUBKEY }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
@@ -173,13 +193,26 @@ jobs:
test -n "$SIGNTOOL_PATH"
echo "SIGNTOOL_PATH=$SIGNTOOL_PATH" >> $GITHUB_ENV
- node rust/apps/ensu/scripts/ci-enable-windows-signing.mjs
-
- - name: Enable updater artifacts for release builds
- shell: bash
- env:
- ENSU_TAURI_UPDATER_PUBKEY: ${{ vars.ENSU_TAURI_UPDATER_PUBKEY }}
- run: node rust/apps/ensu/scripts/ci-enable-updater.mjs
+ : "${ENSU_TAURI_UPDATER_PUBKEY:?}"
+ : "${AZURE_ENDPOINT:?}"
+ : "${AZURE_CODE_SIGNING_NAME:?}"
+ : "${AZURE_CERT_PROFILE_NAME:?}"
+
+ cat > rust/apps/ensu/tauri.ci.conf.json <<EOF
+ {
+ "tauri": {
+ "updater": {
+ "active": true,
+ "pubkey": "${ENSU_TAURI_UPDATER_PUBKEY}"
+ },
+ "bundle": {
+ "windows": {
+ "signCommand": "artifact-signing-cli -e ${AZURE_ENDPOINT} -a ${AZURE_CODE_SIGNING_NAME} -c ${AZURE_CERT_PROFILE_NAME} -d Ensu %1"
+ }
+ }
+ }
+ }
+ EOF
- name: Build and release Tauri app
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0.6.2
@@ -209,7 +242,7 @@ jobs:
includeDebug: false
includeRelease: true
includeUpdaterJson: false
- args: ${{ format('--target {0} --bundles {1} --features updater', matrix.platform.rust-target, matrix.platform.bundle-targets) }}
+ args: ${{ format('--target {0} --bundles {1} --features updater --config tauri.ci.conf.json', matrix.platform.rust-target, matrix.platform.bundle-targets) }}
build-android:
needs: build-metadata
diff --git a/rust/apps/ensu/scripts/ci-enable-updater.mjs b/rust/apps/ensu/scripts/ci-enable-updater.mjs
deleted file mode 100644
index 5b0fdeab65..0000000000
--- a/rust/apps/ensu/scripts/ci-enable-updater.mjs
+++ /dev/null
@@ -1,11 +0,0 @@
-import fs from "node:fs";
-
-const pubkey = process.env.ENSU_TAURI_UPDATER_PUBKEY?.trim();
-if (!pubkey) throw new Error("ENSU_TAURI_UPDATER_PUBKEY is required");
-
-const configPath = new URL("../src-tauri/tauri.conf.json", import.meta.url);
-const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
-config.tauri.updater.active = true;
-config.tauri.updater.pubkey = pubkey;
-
-fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
diff --git a/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs b/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs
deleted file mode 100644
index 53666e276c..0000000000
--- a/rust/apps/ensu/scripts/ci-enable-windows-signing.mjs
+++ /dev/null
@@ -1,18 +0,0 @@
-import fs from "node:fs";
-
-const { AZURE_ENDPOINT, AZURE_CODE_SIGNING_NAME, AZURE_CERT_PROFILE_NAME } =
- process.env;
-
-if (!AZURE_ENDPOINT || !AZURE_CODE_SIGNING_NAME || !AZURE_CERT_PROFILE_NAME) {
- throw new Error(
- "AZURE_ENDPOINT, AZURE_CODE_SIGNING_NAME, and AZURE_CERT_PROFILE_NAME are required",
- );
-}
-
-const configPath = new URL("../src-tauri/tauri.conf.json", import.meta.url);
-const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
-config.tauri.bundle.windows = {
- signCommand: `artifact-signing-cli -e ${AZURE_ENDPOINT} -a ${AZURE_CODE_SIGNING_NAME} -c ${AZURE_CERT_PROFILE_NAME} -d Ensu %1`,
-};
-
-fs.writeFileSync(configPath, JSON.stringify(config, null, 2));