Skip to content

Commit e9a9881

Browse files
committed
build: setting update url for stage release
1 parent 5e13611 commit e9a9881

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.github/workflows/updateNotification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default async function printStuff({github, context, githubWorkspaceRoot})
109109
console.log("Updating tauri update JSON file: ", _identifyUpdateJSONPath(releaseAssets));
110110
const latestJSON = JSON.parse(await _getLatestJson(releaseAssets));
111111
latestJSON.notes = _extractSmallReleaseNotes(releaseNotes, releaseTitle);
112-
const latestJsonPath = `${githubWorkspaceRoot}/${_identifyUpdateJSONPath(releaseAssets)}`;
112+
const latestJsonPath = `${githubWorkspaceRoot}/docs/${_identifyUpdateJSONPath(releaseAssets)}`;
113113
console.log("writing latest json to path: ", latestJsonPath, " contents: ", latestJSON)
114114
fs.writeFileSync(latestJsonPath, JSON.stringify(latestJSON, null, 4));
115115
}

src-build/ci-createDistReleaseConfig.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import {fileURLToPath} from "url";
22
import {dirname, join} from "path";
3-
import {PRODUCT_NAME_SUFFIX_FOR_STAGE} from "./constants.js";
3+
import {
4+
PRODUCT_NAME_SUFFIX_FOR_STAGE,
5+
UPDATE_NOTIFICATION_LATEST_JSON_FILE_PATH,
6+
UPDATE_NOTIFICATIONS_BASE_URL
7+
} from "./constants.js";
48
import { EOL } from "os";
59
import fs from 'fs';
610

@@ -67,6 +71,10 @@ async function ciCreateDistReleaseConfig() {
6771
configJson.package.productName = _getProductName(configJson.package.productName, phoenixStage);
6872
console.log("Product name is: ", configJson.package.productName);
6973
configJson.tauri.windows[0].title = configJson.package.productName;
74+
configJson.tauri.updater.endpoints = [
75+
`${UPDATE_NOTIFICATIONS_BASE_URL}${UPDATE_NOTIFICATION_LATEST_JSON_FILE_PATH[phoenixStage]}`
76+
];
77+
console.log("Product update endpoints are: ", configJson.tauri.updater.endpoints);
7078
console.log("Writing new dist config json ", tauriConfigPath);
7179
fs.writeFileSync(tauriConfigPath, JSON.stringify(configJson, null, 4));
7280
return phoenixVersion;

src-build/constants.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ export const PRODUCT_NAME_SUFFIX_FOR_STAGE = {
99
export const UPDATE_NOTIFICATION_LATEST_JSON_FILE_PATH = {
1010
// do not change any of these names unless you want to nuke the updater for all the whole installation base!!
1111
// or you know what you are doing.
12-
dev: "docs/tauri/update-latest-experimental-build.json",
13-
stage: "docs/tauri/update-latest-pre-release.json",
14-
production: "docs/tauri/update-latest-stable-prod.json"
12+
dev: "tauri/update-latest-experimental-build.json",
13+
stage: "tauri/update-latest-pre-release.json",
14+
production: "tauri/update-latest-stable-prod.json"
1515
};
1616

17+
export const UPDATE_NOTIFICATIONS_BASE_URL = "https://updates.phcode.io/";
18+
1719
// latest.json file that is generated as part of tauri build in every GitHub release. it is generated by tauri build action.
1820
export const LATEST_JSON_GITHUB_RELEASE = "latest.json";

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"installMode": "passive"
8080
},
8181
"endpoints": [
82-
"https://releases.phcode.dev/{{target}}/{{arch}}/{{current_version}}"
82+
"https://updates.phcode.io/tauri/update-latest-experimental-build.json"
8383
],
8484
"dialog": true,
8585
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDY2QTY2RjMxQUIzQkU0RDQKUldUVTVEdXJNVyttWmc2ODNSODlVcmZhS0dFRW1mYnBkaytvTDcrSDJXSlhYOHVrUWRyaXhHRjcK"

0 commit comments

Comments
 (0)