Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

chore(ci): one name per build version and channel (#3615)

Hampusc59b62cf1a10
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index f72013733..f17b89006 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -76,6 +76,19 @@ Complete every section of the pull request template. Clearly describe:
- What risks it introduces.
- How it was verified.
+## Build version and channel
+
+Two environment variables set the version and channel of a desktop or web build. You can leave both unset for a local build.
+
+| Variable | What it sets | Set by | When unset |
+| --- | --- | --- | --- |
+| `BUILD_VERSION` | The CalVer version (`YYYY.MDD.MICRO`) of the build. The web app shows it in its build info and `version.json`, and the desktop app uses it as its own version. | The release workflows, or `BUILD_VERSION` as a build argument when you build the app-proxy image yourself. | `dev` for the web app. A desktop package uses the version of the web app it bundles. |
+| `BUILD_CHANNEL` | `stable`, `canary` or `development`. For the desktop app it decides the app ID, data folder, link protocol and update feed. For the web app it is the channel used when the page has no channel tag. | The desktop release workflows. | `canary` for the web app and `stable` for the desktop app. |
+
+The app-proxy sets the channel of the web app when it serves the page, using its own `RELEASE_CHANNEL` setting, and the image build leaves `BUILD_CHANNEL` unset.
+
+A build stops with an error when it finds one of the old names `PUBLIC_BUILD_VERSION`, `PUBLIC_RELEASE_CHANNEL`, `RELEASE_CHANNEL` or `VERSION` without the new name.
+
## Reports and other contributions
Report bugs and request features at [feedback.fluxer.com](https://feedback.fluxer.com).
diff --git a/.github/workflows/_build-image.yaml b/.github/workflows/_build-image.yaml
index 0e069d2b0..ee6842091 100644
--- a/.github/workflows/_build-image.yaml
+++ b/.github/workflows/_build-image.yaml
@@ -63,7 +63,7 @@ jobs:
id: vars
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- FLUXER_BUILD_VERSION: ${{ inputs['build-version'] }}
+ BUILD_VERSION: ${{ inputs['build-version'] }}
run: >-
tools/ci/run.sh resolve-calver
--github-output
diff --git a/.github/workflows/build-desktop-modules.yaml b/.github/workflows/build-desktop-modules.yaml
index 562e4f310..b95b86ecf 100644
--- a/.github/workflows/build-desktop-modules.yaml
+++ b/.github/workflows/build-desktop-modules.yaml
@@ -35,7 +35,6 @@ concurrency:
cancel-in-progress: false
env:
- CHANNEL: ${{ inputs.channel }}
BUILD_CHANNEL: ${{ inputs.channel == 'canary' && 'canary' || 'stable' }}
jobs:
@@ -49,7 +48,6 @@ jobs:
outputs:
version: ${{ steps.meta.outputs.version }}
pub_date: ${{ steps.meta.outputs.pub_date }}
- channel: ${{ steps.meta.outputs.channel }}
build_channel: ${{ steps.meta.outputs.build_channel }}
source_sha: ${{ steps.meta.outputs.source_sha }}
steps:
@@ -76,7 +74,7 @@ jobs:
id: meta
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- FLUXER_BUILD_VERSION: ${{ inputs.build_version }}
+ BUILD_VERSION: ${{ inputs.build_version }}
run: >-
cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-desktop
--step set_metadata
@@ -92,13 +90,7 @@ jobs:
permissions:
contents: read
env:
- CHANNEL: ${{ needs.meta.outputs.channel }}
- BUILD_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- PUBLIC_RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
BUILD_VERSION: ${{ needs.meta.outputs.version }}
- PUBLIC_BUILD_VERSION: ${{ needs.meta.outputs.version }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
steps:
- name: Checkout CI helpers
@@ -233,8 +225,7 @@ jobs:
actions: read
contents: read
env:
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
+ BUILD_VERSION: ${{ needs.meta.outputs.version }}
PUB_DATE: ${{ needs.meta.outputs.pub_date }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
steps:
@@ -304,8 +295,7 @@ jobs:
permissions:
contents: write
env:
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
+ BUILD_VERSION: ${{ needs.meta.outputs.version }}
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
@@ -335,21 +325,19 @@ jobs:
- name: Publish GitHub modules-only release
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
RELEASE_BASELINE_SHA: ${{ vars.RELEASE_BASELINE_SHA }}
run: |
set -euo pipefail
release_args=(
release publish
- --component "fluxer-desktop-${CHANNEL}"
- --build-version "${VERSION}"
+ --component "fluxer-desktop-${BUILD_CHANNEL}"
+ --build-version "${BUILD_VERSION}"
--source-sha "${SOURCE_SHA}"
--previous-sha "${RELEASE_BASELINE_SHA}"
--asset-dir release_assets
)
- if [[ "${CHANNEL}" == "canary" ]]; then
+ if [[ "${BUILD_CHANNEL}" == "canary" ]]; then
release_args+=(--prerelease)
fi
cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- "${release_args[@]}"
diff --git a/.github/workflows/build-desktop.yaml b/.github/workflows/build-desktop.yaml
index 59a7fc2c6..8c65fc3b3 100644
--- a/.github/workflows/build-desktop.yaml
+++ b/.github/workflows/build-desktop.yaml
@@ -40,7 +40,6 @@ concurrency:
cancel-in-progress: false
env:
- CHANNEL: ${{ inputs.channel }}
BUILD_CHANNEL: ${{ inputs.channel == 'canary' && 'canary' || 'stable' }}
jobs:
@@ -55,7 +54,6 @@ jobs:
outputs:
version: ${{ steps.meta.outputs.version }}
pub_date: ${{ steps.meta.outputs.pub_date }}
- channel: ${{ steps.meta.outputs.channel }}
build_channel: ${{ steps.meta.outputs.build_channel }}
source_sha: ${{ steps.meta.outputs.source_sha }}
steps:
@@ -83,7 +81,7 @@ jobs:
id: meta
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- FLUXER_BUILD_VERSION: ${{ inputs.build_version }}
+ BUILD_VERSION: ${{ inputs.build_version }}
run: >-
cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-desktop
--step set_metadata
@@ -92,9 +90,8 @@ jobs:
- name: Check which shells run these modules
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- CHANNEL: ${{ steps.meta.outputs.build_channel }}
SOURCE_SHA: ${{ steps.meta.outputs.source_sha }}
- VERSION: ${{ steps.meta.outputs.version }}
+ BUILD_VERSION: ${{ steps.meta.outputs.version }}
SHELL_CONTRACT: ${{ inputs.shell_contract }}
DESKTOP_MODULES_ONLY_RELEASE: false
run: >-
@@ -136,13 +133,7 @@ jobs:
permissions:
contents: read
env:
- CHANNEL: ${{ needs.meta.outputs.channel }}
- BUILD_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- PUBLIC_RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
BUILD_VERSION: ${{ needs.meta.outputs.version }}
- PUBLIC_BUILD_VERSION: ${{ needs.meta.outputs.version }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
steps:
- name: Checkout CI helpers
@@ -281,13 +272,7 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
env:
- CHANNEL: ${{ needs.meta.outputs.channel }}
- BUILD_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- PUBLIC_RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
BUILD_VERSION: ${{ needs.meta.outputs.version }}
- PUBLIC_BUILD_VERSION: ${{ needs.meta.outputs.version }}
PUB_DATE: ${{ needs.meta.outputs.pub_date }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
DESKTOP_PLATFORM: ${{ matrix.platform }}
@@ -433,8 +418,6 @@ jobs:
- name: Set build channel
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step set_build_channel
@@ -452,8 +435,6 @@ jobs:
- name: Build Electron main process
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step build_electron_main
@@ -475,7 +456,6 @@ jobs:
if: matrix.platform == 'macos'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
@@ -488,8 +468,6 @@ jobs:
- name: Verify macOS artifact (bundle ID + profile + signature)
if: matrix.platform == 'macos'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step verify_bundle_id
@@ -498,7 +476,6 @@ jobs:
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
TEMP: C:\t
TMP: C:\t
ELECTRON_BUILDER_CACHE: C:\ebcache
@@ -544,8 +521,6 @@ jobs:
id: resolve_unpacked
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step resolve_windows_unpacked_dir
@@ -568,8 +543,6 @@ jobs:
- name: Verify unpacked Windows signatures
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step verify_windows_unpacked_signatures
@@ -577,9 +550,6 @@ jobs:
- name: Verify the packaged shell starts and boots its bundled renderer (Windows)
if: matrix.platform == 'windows' && matrix.arch == 'x64'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
- BUILD_VERSION: ${{ env.VERSION }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step verify_bundled_renderer_windows
@@ -587,8 +557,6 @@ jobs:
- name: Create portable ZIP (Windows)
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step create_portable_zip_windows
@@ -596,8 +564,6 @@ jobs:
- name: Package Windows app with Velopack
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step package_app_windows_velopack
@@ -606,8 +572,6 @@ jobs:
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
env:
- BUILD_VERSION: ${{ env.VERSION }}
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
MAX_WINDOWS_PATH_LEN: 260
PATH_HEADROOM: 10
run: >-
@@ -635,7 +599,6 @@ jobs:
if: matrix.platform == 'linux'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
USE_SYSTEM_FPM: true
FLUXER_ELECTRON_DIST: ${{ runner.temp }}/fluxer-electron-dist
run: >-
@@ -645,9 +608,6 @@ jobs:
- name: Verify the packaged shell boots its bundled renderer (Linux)
if: matrix.platform == 'linux' && matrix.arch == 'x64'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
- BUILD_VERSION: ${{ env.VERSION }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step verify_bundled_renderer_linux
@@ -655,8 +615,6 @@ jobs:
- name: Verify signed Windows artifacts
if: matrix.platform == 'windows'
working-directory: ${{ env.WORKDIR }}/fluxer_desktop
- env:
- BUILD_CHANNEL: ${{ env.BUILD_CHANNEL }}
run: >-
cargo run --locked --quiet --manifest-path ${{ github.workspace }}/_ci/tools/ci/Cargo.toml -- build-desktop
--step verify_windows_signed_artifacts
@@ -724,8 +682,7 @@ jobs:
actions: read
contents: read
env:
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
+ BUILD_VERSION: ${{ needs.meta.outputs.version }}
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
@@ -748,13 +705,13 @@ jobs:
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
- $zip = Get-ChildItem -Path artifacts -Recurse -Filter "*-$env:VERSION-portable-win-arm64.zip" | Select-Object -First 1
+ $zip = Get-ChildItem -Path artifacts -Recurse -Filter "*-$env:BUILD_VERSION-portable-win-arm64.zip" | Select-Object -First 1
if ($null -eq $zip) { Write-Host 'This build has no windows arm64 portable zip'; exit 0 }
$app = Join-Path $env:RUNNER_TEMP 'app'
Expand-Archive -Path $zip.FullName -DestinationPath $app
$exe = Get-ChildItem -Path $app -Recurse -Filter 'Fluxer*.exe' | Where-Object { $_.Name -notlike '*_ExecutionStub.exe' } | Select-Object -First 1
if ($null -eq $exe) { throw "$($zip.Name) holds no Fluxer executable" }
- node fluxer_desktop/scripts/release-check.mjs --app $exe.DirectoryName --channel $env:CHANNEL --expect-renderer $env:VERSION --expect-source bundled --package-origin http://127.0.0.1:9 --app-arg=--disable-gpu --workdir (Join-Path $env:RUNNER_TEMP 'runs') --timeout-seconds 240
+ node fluxer_desktop/scripts/release-check.mjs --app $exe.DirectoryName --channel $env:BUILD_CHANNEL --expect-renderer $env:BUILD_VERSION --expect-source bundled --package-origin http://127.0.0.1:9 --app-arg=--disable-gpu --workdir (Join-Path $env:RUNNER_TEMP 'runs') --timeout-seconds 240
if ($LASTEXITCODE -ne 0) { throw "The windows arm64 build fails its release check" }
upload:
@@ -772,13 +729,7 @@ jobs:
actions: read
contents: read
env:
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- DISPLAY_CHANNEL: ${{ needs.meta.outputs.channel }}
- RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- PUBLIC_RELEASE_CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
BUILD_VERSION: ${{ needs.meta.outputs.version }}
- PUBLIC_BUILD_VERSION: ${{ needs.meta.outputs.version }}
PUB_DATE: ${{ needs.meta.outputs.pub_date }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
steps:
@@ -801,7 +752,6 @@ jobs:
- name: Build payload layout (+ manifest.json)
env:
- VERSION: ${{ needs.meta.outputs.version }}
PUB_DATE: ${{ needs.meta.outputs.pub_date }}
run: >-
cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-desktop
@@ -867,8 +817,7 @@ jobs:
permissions:
contents: write
env:
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
+ BUILD_VERSION: ${{ needs.meta.outputs.version }}
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
@@ -898,21 +847,19 @@ jobs:
- name: Publish GitHub desktop release
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- CHANNEL: ${{ needs.meta.outputs.build_channel }}
- VERSION: ${{ needs.meta.outputs.version }}
SOURCE_SHA: ${{ needs.meta.outputs.source_sha }}
RELEASE_BASELINE_SHA: ${{ vars.RELEASE_BASELINE_SHA }}
run: |
set -euo pipefail
release_args=(
release publish
- --component "fluxer-desktop-${CHANNEL}"
- --build-version "${VERSION}"
+ --component "fluxer-desktop-${BUILD_CHANNEL}"
+ --build-version "${BUILD_VERSION}"
--source-sha "${SOURCE_SHA}"
--previous-sha "${RELEASE_BASELINE_SHA}"
--asset-dir release_assets
)
- if [[ "${CHANNEL}" == "canary" ]]; then
+ if [[ "${BUILD_CHANNEL}" == "canary" ]]; then
release_args+=(--prerelease)
fi
cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- "${release_args[@]}"
diff --git a/.github/workflows/release-image-set.yaml b/.github/workflows/release-image-set.yaml
index 048a0feaf..f05098bf5 100644
--- a/.github/workflows/release-image-set.yaml
+++ b/.github/workflows/release-image-set.yaml
@@ -87,7 +87,7 @@ jobs:
id: vars
env:
GH_TOKEN: ${{ steps.create-token.outputs.token }}
- FLUXER_BUILD_VERSION: ${{ inputs['build-version'] }}
+ BUILD_VERSION: ${{ inputs['build-version'] }}
run: >-
tools/ci/run.sh resolve-calver
--github-output
diff --git a/config/env/development.env b/config/env/development.env
index f04881927..7861db553 100644
--- a/config/env/development.env
+++ b/config/env/development.env
@@ -118,8 +118,6 @@ FLUXER_SELF_HOSTED=true
FLUXER_DISABLE_RATE_LIMITS=true
FLUXER_TEST_MODE_ENABLED=false
-PUBLIC_BUILD_VERSION=dev
-PUBLIC_RELEASE_CHANNEL=canary
FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=Zmx1eGVyLWRldi11cGxvYWQtcmVsYXktc2VjcmV0LTAwMDA=
FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64=Zmx1eGVyLWRldi1hdHRhY2htZW50LXVybC1zZWNyZXQ=
AWS_EC2_METADATA_DISABLED=true
diff --git a/fluxer_app/rspack.config.mjs b/fluxer_app/rspack.config.mjs
index cfbc19225..4b552d2b5 100644
--- a/fluxer_app/rspack.config.mjs
+++ b/fluxer_app/rspack.config.mjs
@@ -355,26 +355,36 @@ function devServerHeaders() {
return {...devCorsHeaders, ...devNoStoreHeaders};
}
-function resolveReleaseChannel() {
- const value = envString('PUBLIC_RELEASE_CHANNEL', envString('RELEASE_CHANNEL', 'canary')).trim().toLowerCase();
+const RENAMED_BUILD_ENV = {
+ PUBLIC_BUILD_VERSION: 'BUILD_VERSION',
+ PUBLIC_RELEASE_CHANNEL: 'BUILD_CHANNEL',
+ RELEASE_CHANNEL: 'BUILD_CHANNEL',
+};
+
+function rejectRenamedBuildEnv() {
+ for (const [oldName, newName] of Object.entries(RENAMED_BUILD_ENV)) {
+ if (envString(oldName) !== undefined && envString(newName) === undefined) {
+ throw new Error(`The web build no longer reads ${oldName}. Set ${newName} instead.`);
+ }
+ }
+}
+
+function resolveBuildChannel() {
+ const value = envString('BUILD_CHANNEL', 'canary').trim().toLowerCase();
if (value === 'stable' || value === 'canary' || value === 'development') {
return value;
}
- throw new Error(`PUBLIC_RELEASE_CHANNEL must be stable, canary, or development, received ${JSON.stringify(value)}`);
+ throw new Error(`BUILD_CHANNEL must be stable, canary, or development, received ${JSON.stringify(value)}`);
}
-function resolvePublicValues() {
+function resolveBuildInfo() {
+ rejectRenamedBuildEnv();
return {
- PUBLIC_BUILD_VERSION: envString('PUBLIC_BUILD_VERSION', envString('BUILD_VERSION', 'dev')),
- PUBLIC_RELEASE_CHANNEL: resolveReleaseChannel(),
+ version: envString('BUILD_VERSION', 'dev'),
+ channel: resolveBuildChannel(),
};
}
-function getPublicEnvVar(values, name) {
- const value = values[name];
- return value === undefined ? 'undefined' : JSON.stringify(value);
-}
-
function getChunkRuntimeNames(runtime) {
if (runtime == null) {
return [];
@@ -415,7 +425,7 @@ function jsFilename(pathData) {
export default () => {
const linguiSwcPlugin = getLinguiSwcPluginConfig();
- const publicValues = resolvePublicValues();
+ const buildInfo = resolveBuildInfo();
const assetBaseUrl = isDesktopRenderer ? undefined : envString('PUBLIC_ASSET_BASE_URL');
const staticCdnEndpoint = isDesktopRenderer
? ''
@@ -698,13 +708,13 @@ export default () => {
new DefinePlugin({
define: 'undefined',
__FLUXER_PRECACHE_MANIFEST__: JSON.stringify([]),
- __FLUXER_SW_VERSION__: JSON.stringify(publicValues.PUBLIC_BUILD_VERSION || 'dev'),
+ __FLUXER_SW_VERSION__: JSON.stringify(buildInfo.version),
'process.env.NODE_ENV': JSON.stringify(mode),
'import.meta.env.DEV': JSON.stringify(isDevelopment),
'import.meta.env.PROD': JSON.stringify(isProduction),
'import.meta.env.MODE': JSON.stringify(mode),
- 'import.meta.env.PUBLIC_BUILD_VERSION': getPublicEnvVar(publicValues, 'PUBLIC_BUILD_VERSION'),
- 'import.meta.env.PUBLIC_RELEASE_CHANNEL': getPublicEnvVar(publicValues, 'PUBLIC_RELEASE_CHANNEL'),
+ 'import.meta.env.BUILD_VERSION': JSON.stringify(buildInfo.version),
+ 'import.meta.env.BUILD_CHANNEL': JSON.stringify(buildInfo.channel),
}),
{
apply(compiler) {
@@ -715,7 +725,7 @@ export default () => {
() => {
const {RawSource} = compiler.rspack.sources;
const versionData = {
- version: publicValues.PUBLIC_BUILD_VERSION,
+ version: buildInfo.version,
};
const source = new RawSource(JSON.stringify(versionData));
compilation.emitAsset('version.json', source);
diff --git a/fluxer_app/scripts/build/utils/ServiceWorker.tsx b/fluxer_app/scripts/build/utils/ServiceWorker.tsx
index 291a544b8..7ad0c2873 100644
--- a/fluxer_app/scripts/build/utils/ServiceWorker.tsx
+++ b/fluxer_app/scripts/build/utils/ServiceWorker.tsx
@@ -26,7 +26,6 @@ async function collectPrecacheManifest(): Promise<Array<PrecacheEntry>> {
export async function buildServiceWorker(production: boolean): Promise<void> {
const precacheManifest = await collectPrecacheManifest();
- const buildVersion = process.env.PUBLIC_BUILD_SHA || process.env.BUILD_SHA || String(Date.now());
await esbuild.build({
entryPoints: [path.join(SRC_DIR, 'features', 'platform', 'service_worker', 'Worker.ts')],
bundle: true,
@@ -38,7 +37,7 @@ export async function buildServiceWorker(production: boolean): Promise<void> {
define: {
__WB_MANIFEST: '[]',
__FLUXER_PRECACHE_MANIFEST__: JSON.stringify(precacheManifest),
- __FLUXER_SW_VERSION__: JSON.stringify(buildVersion),
+ __FLUXER_SW_VERSION__: JSON.stringify(String(Date.now())),
},
});
}
diff --git a/fluxer_app/src/env.d.ts b/fluxer_app/src/env.d.ts
index 0e772361e..4cdeedfc6 100644
--- a/fluxer_app/src/env.d.ts
+++ b/fluxer_app/src/env.d.ts
@@ -45,8 +45,8 @@ declare global {
readonly MODE: 'development' | 'production' | 'test';
readonly DEV: boolean;
readonly PROD: boolean;
- readonly PUBLIC_BUILD_VERSION?: string;
- readonly PUBLIC_RELEASE_CHANNEL?: 'stable' | 'canary' | 'development';
+ readonly BUILD_VERSION?: string;
+ readonly BUILD_CHANNEL?: 'stable' | 'canary' | 'development';
}
interface ImportMetaHot {
readonly data: Record<string, unknown>;
diff --git a/fluxer_app/src/features/app/components/dialogs/components/ClientInfo.tsx b/fluxer_app/src/features/app/components/dialogs/components/ClientInfo.tsx
index d91b30705..c98cd5cb6 100644
--- a/fluxer_app/src/features/app/components/dialogs/components/ClientInfo.tsx
+++ b/fluxer_app/src/features/app/components/dialogs/components/ClientInfo.tsx
@@ -75,8 +75,8 @@ export const ClientInfo = observer(() => {
return `${parts.join(' ')}${archSuffix}`.trim();
};
const osDescription = buildOsDescription();
- const releaseChannel = formatReleaseChannelLabel(Config.PUBLIC_RELEASE_CHANNEL);
- const buildVersion = Config.PUBLIC_BUILD_VERSION || 'dev';
+ const releaseChannel = formatReleaseChannelLabel(Config.RELEASE_CHANNEL);
+ const buildVersion = Config.BUILD_VERSION || 'dev';
const desktopReleaseChannel = desktopChannel ? formatReleaseChannelLabel(desktopChannel) : null;
const primaryDesktopReleaseChannel = desktopReleaseChannel ?? releaseChannel;
const desktopVersionLabel = desktopVersion;
diff --git a/fluxer_app/src/features/app/components/layout/app_layout/AppLayoutHooks.ts b/fluxer_app/src/features/app/components/layout/app_layout/AppLayoutHooks.ts
index 9ad2998b3..ebae34d13 100644
--- a/fluxer_app/src/features/app/components/layout/app_layout/AppLayoutHooks.ts
+++ b/fluxer_app/src/features/app/components/layout/app_layout/AppLayoutHooks.ts
@@ -284,7 +284,7 @@ export const useNagbarConditions = (): NagbarConditions => {
canShowDomainMoved = DomainMovedNotice.shouldShow(Date.now());
}
const canShowBuildEnvironment =
- !BUILD_ENVIRONMENT_HIDDEN_RELEASE_CHANNELS.has(Config.PUBLIC_RELEASE_CHANNEL) &&
+ !BUILD_ENVIRONMENT_HIDDEN_RELEASE_CHANNELS.has(Config.RELEASE_CHANNEL) &&
!nagbarState.buildEnvironmentDismissedThisSession;
let canShowConnection: boolean;
if (nagbarState.forceHideConnectionNotice) {
diff --git a/fluxer_app/src/features/app/components/layout/app_layout/nagbars/BuildEnvironmentNagbar.tsx b/fluxer_app/src/features/app/components/layout/app_layout/nagbars/BuildEnvironmentNagbar.tsx
index a06d3948f..38548c169 100644
--- a/fluxer_app/src/features/app/components/layout/app_layout/nagbars/BuildEnvironmentNagbar.tsx
+++ b/fluxer_app/src/features/app/components/layout/app_layout/nagbars/BuildEnvironmentNagbar.tsx
@@ -30,7 +30,7 @@ export function BuildEnvironmentNagbar({isMobile}: {isMobile: boolean}) {
isMobile={isMobile}
onDismiss={NagbarController.dismissBuildEnvironmentNagbar}
message={i18n._(BUILD_ENVIRONMENT_MESSAGE_DESCRIPTOR, {
- releaseChannel: Config.PUBLIC_RELEASE_CHANNEL,
+ releaseChannel: Config.RELEASE_CHANNEL,
productName: RuntimeConfig.productName,
})}
data-flx="app.app-layout.nagbars.build-environment-nagbar.nagbar-content"
diff --git a/fluxer_app/src/features/app/config/Config.ts b/fluxer_app/src/features/app/config/Config.ts
index b3532ed59..440669250 100644
--- a/fluxer_app/src/features/app/config/Config.ts
+++ b/fluxer_app/src/features/app/config/Config.ts
@@ -3,21 +3,21 @@
import * as v from 'valibot';
const buildInfoSchema = v.object({
- PUBLIC_BUILD_VERSION: v.nullish(v.string(), 'dev'),
- PUBLIC_RELEASE_CHANNEL: v.picklist(['stable', 'canary', 'development']),
+ BUILD_VERSION: v.nullish(v.string(), 'dev'),
+ BUILD_CHANNEL: v.picklist(['stable', 'canary', 'development']),
});
class BuildInfoInvariantError extends Error {
constructor(issues: string) {
super(
- `Invalid build info: ${issues}. PUBLIC_BUILD_VERSION and PUBLIC_RELEASE_CHANNEL are injected by rspack at build time. PUBLIC_RELEASE_CHANNEL must be stable, canary or development.`,
+ `Invalid build info: ${issues}. rspack injects BUILD_VERSION and BUILD_CHANNEL at build time. BUILD_CHANNEL must be stable, canary or development.`,
);
this.name = 'BuildInfoInvariantError';
}
}
const parsedBuildInfo = v.safeParse(buildInfoSchema, {
- PUBLIC_BUILD_VERSION: import.meta.env.PUBLIC_BUILD_VERSION,
- PUBLIC_RELEASE_CHANNEL: import.meta.env.PUBLIC_RELEASE_CHANNEL,
+ BUILD_VERSION: import.meta.env.BUILD_VERSION,
+ BUILD_CHANNEL: import.meta.env.BUILD_CHANNEL,
});
if (!parsedBuildInfo.success) {
throw new BuildInfoInvariantError(parsedBuildInfo.issues.map((issue) => issue.message).join(', '));
@@ -34,7 +34,7 @@ function servedReleaseChannel(): 'stable' | 'canary' | null {
return value === 'stable' || value === 'canary' ? value : null;
}
-function clientReleaseChannel(value: (typeof buildInfo)['PUBLIC_RELEASE_CHANNEL']): 'stable' | 'canary' {
+function clientReleaseChannel(value: (typeof buildInfo)['BUILD_CHANNEL']): 'stable' | 'canary' {
switch (value) {
case 'stable':
return 'stable';
@@ -45,6 +45,6 @@ function clientReleaseChannel(value: (typeof buildInfo)['PUBLIC_RELEASE_CHANNEL'
}
export default {
- PUBLIC_BUILD_VERSION: buildInfo.PUBLIC_BUILD_VERSION,
- PUBLIC_RELEASE_CHANNEL: servedReleaseChannel() ?? clientReleaseChannel(buildInfo.PUBLIC_RELEASE_CHANNEL),
+ BUILD_VERSION: buildInfo.BUILD_VERSION,
+ RELEASE_CHANNEL: servedReleaseChannel() ?? clientReleaseChannel(buildInfo.BUILD_CHANNEL),
} as const;
diff --git a/fluxer_app/src/features/app/config/I18nDisplayConstants.ts b/fluxer_app/src/features/app/config/I18nDisplayConstants.ts
index accc4363f..e3bbb4325 100644
--- a/fluxer_app/src/features/app/config/I18nDisplayConstants.ts
+++ b/fluxer_app/src/features/app/config/I18nDisplayConstants.ts
@@ -48,8 +48,7 @@ const DESKTOP_DOWNLOAD_URLS: Record<string, string> = {
development: 'http://localhost:8088/download',
};
-export const DESKTOP_DOWNLOAD_URL =
- DESKTOP_DOWNLOAD_URLS[Config.PUBLIC_RELEASE_CHANNEL] ?? DESKTOP_DOWNLOAD_URLS.stable;
+export const DESKTOP_DOWNLOAD_URL = DESKTOP_DOWNLOAD_URLS[Config.RELEASE_CHANNEL] ?? DESKTOP_DOWNLOAD_URLS.stable;
export const FLUXER_DOCS_DOMAIN = 'fluxer.dev';
export const FLUXER_DOCS_URL = `https://${FLUXER_DOCS_DOMAIN}`;
export const FLUXER_BLUESKY_HANDLE = '@fluxer.app';
diff --git a/fluxer_app/src/features/app/state/InstanceSnapshotStore.ts b/fluxer_app/src/features/app/state/InstanceSnapshotStore.ts
index 65e03b9da..493dea4f8 100644
--- a/fluxer_app/src/features/app/state/InstanceSnapshotStore.ts
+++ b/fluxer_app/src/features/app/state/InstanceSnapshotStore.ts
@@ -136,7 +136,7 @@ function endpointHostname(endpoint: string): string | null {
}
function bootstrapReleaseChannel(): OfficialReleaseChannel {
- return Config.PUBLIC_RELEASE_CHANNEL === 'stable' ? 'stable' : 'canary';
+ return Config.RELEASE_CHANNEL === 'stable' ? 'stable' : 'canary';
}
const SAME_ORIGIN_API_META_SELECTOR = 'meta[name="fluxer-api-origin"][content="self"]';
diff --git a/fluxer_app/src/features/app/state/Updater.ts b/fluxer_app/src/features/app/state/Updater.ts
index d4beed8cc..e1adf172f 100644
--- a/fluxer_app/src/features/app/state/Updater.ts
+++ b/fluxer_app/src/features/app/state/Updater.ts
@@ -68,7 +68,7 @@ const MIN_CHECK_INTERVAL_MS = 60 * 1000;
const WEB_CHECK_TIMEOUT_MS = 15 * 1000;
const NATIVE_CHECK_TIMEOUT_MS = 30 * 1000;
const VERSION_ENDPOINT = '/version.json';
-const CURRENT_BUILD_VERSION = Config.PUBLIC_BUILD_VERSION ?? null;
+const CURRENT_BUILD_VERSION = Config.BUILD_VERSION ?? null;
function loadUpdaterModals(): Promise<typeof UpdaterModalCommands> {
return import('@app/features/updater/commands/UpdaterModalCommands');
diff --git a/fluxer_app/src/features/auth/flow/InstanceSelector.tsx b/fluxer_app/src/features/auth/flow/InstanceSelector.tsx
index 7294248ea..5b2f44660 100644
--- a/fluxer_app/src/features/auth/flow/InstanceSelector.tsx
+++ b/fluxer_app/src/features/auth/flow/InstanceSelector.tsx
@@ -322,7 +322,7 @@ export const InstanceSelector = observer(function InstanceSelector({
[discoveryRequestOwner, onChange, updateDiscoveryStatus],
);
const handleSelectOfficial = useCallback(() => {
- const origin = officialMarketingOrigin(Config.PUBLIC_RELEASE_CHANNEL);
+ const origin = officialMarketingOrigin(Config.RELEASE_CHANNEL);
onChange(origin);
startDiscovery(origin, false);
}, [onChange, startDiscovery]);
diff --git a/fluxer_app/src/features/platform/service_worker/Register.ts b/fluxer_app/src/features/platform/service_worker/Register.ts
index 751eaefa0..05dc4157d 100644
--- a/fluxer_app/src/features/platform/service_worker/Register.ts
+++ b/fluxer_app/src/features/platform/service_worker/Register.ts
@@ -42,9 +42,7 @@ async function clearFluxerServiceWorkerCaches(): Promise<Array<string>> {
}
export function shouldDisableServiceWorkersForLocalDev(): boolean {
- return (
- import.meta.env.MODE === 'development' || (Config.PUBLIC_BUILD_VERSION ?? 'dev').trim().toLowerCase() === 'dev'
- );
+ return import.meta.env.MODE === 'development' || (Config.BUILD_VERSION ?? 'dev').trim().toLowerCase() === 'dev';
}
async function unregisterFluxerServiceWorkers({
@@ -108,7 +106,7 @@ export async function registerServiceWorker(): Promise<ServiceWorkerRegistration
return;
}
try {
- const versionParam = Config.PUBLIC_BUILD_VERSION || 'dev';
+ const versionParam = Config.BUILD_VERSION || 'dev';
const swUrl = resolveDocumentURLFromRoot('/sw.js');
swUrl.searchParams.set('v', String(versionParam));
return await navigator.serviceWorker.register(`${swUrl.pathname}${swUrl.search}`);
diff --git a/fluxer_app/src/features/platform/utils/ClientInfo.ts b/fluxer_app/src/features/platform/utils/ClientInfo.ts
index 40889925f..a003ce1b4 100644
--- a/fluxer_app/src/features/platform/utils/ClientInfo.ts
+++ b/fluxer_app/src/features/platform/utils/ClientInfo.ts
@@ -252,8 +252,8 @@ function formatTranslationDomGuardFires(): string {
}
export function formatClientBuildInfo(info: ClientInfo, options: {unknownLabel?: string} = {}): string {
- const releaseChannel = formatReleaseChannelLabel(Config.PUBLIC_RELEASE_CHANNEL);
- const buildVersion = Config.PUBLIC_BUILD_VERSION || 'dev';
+ const releaseChannel = formatReleaseChannelLabel(Config.RELEASE_CHANNEL);
+ const buildVersion = Config.BUILD_VERSION || 'dev';
const browserName = info.browserName || options.unknownLabel || '';
const browserVersion = info.browserVersion || '';
const browserInfo = `${browserName} ${browserVersion}`.trim();
@@ -329,7 +329,7 @@ export async function getGatewayClientProperties(geo?: {latitude?: string | null
system_locale: navigator.language,
locale: navigator.language,
user_agent: navigator.userAgent,
- build_version: Config.PUBLIC_BUILD_VERSION ?? 'dev',
+ build_version: Config.BUILD_VERSION ?? 'dev',
desktop_app_version: info.desktopVersion ?? null,
desktop_app_channel: info.desktopChannel ?? null,
desktop_arch: info.desktopArch ?? info.arch ?? null,
diff --git a/fluxer_app/src/features/platform/utils/WorkerAssetUrl.ts b/fluxer_app/src/features/platform/utils/WorkerAssetUrl.ts
index 389fa21e0..f7f064129 100644
--- a/fluxer_app/src/features/platform/utils/WorkerAssetUrl.ts
+++ b/fluxer_app/src/features/platform/utils/WorkerAssetUrl.ts
@@ -30,7 +30,7 @@ function getWorkerAssetBuildVersion(explicitBuildVersion?: string | number | nul
if (explicitBuildVersion !== undefined) {
return normalizeBuildVersion(explicitBuildVersion);
}
- return normalizeBuildVersion(import.meta.env.PUBLIC_BUILD_VERSION);
+ return normalizeBuildVersion(import.meta.env.BUILD_VERSION);
}
function withWorkerAssetVersion(assetUrl: URL, buildVersion: string | null): string {
diff --git a/fluxer_app/src/features/voice/diagnostics/VoiceSubscriptionDebugReport.ts b/fluxer_app/src/features/voice/diagnostics/VoiceSubscriptionDebugReport.ts
index 3137912bf..539805b1d 100644
--- a/fluxer_app/src/features/voice/diagnostics/VoiceSubscriptionDebugReport.ts
+++ b/fluxer_app/src/features/voice/diagnostics/VoiceSubscriptionDebugReport.ts
@@ -175,7 +175,7 @@ export function collectVoiceSubscriptionDebugReport(): VoiceSubscriptionDebugRep
const pendingSubscriptionCommands = Array.from(snapshot.subscriptionCommands);
return {
capturedAt: new Date().toISOString(),
- buildVersion: Config.PUBLIC_BUILD_VERSION ?? 'dev',
+ buildVersion: Config.BUILD_VERSION ?? 'dev',
graphNowMs: voiceMediaGraphStore.nowMs(),
connection: {
connected: MediaEngine.connected,
diff --git a/fluxer_app/src/features/voice/utils/StatsForNerdsCopy.ts b/fluxer_app/src/features/voice/utils/StatsForNerdsCopy.ts
index e881bc10a..6877c3a5a 100644
--- a/fluxer_app/src/features/voice/utils/StatsForNerdsCopy.ts
+++ b/fluxer_app/src/features/voice/utils/StatsForNerdsCopy.ts
@@ -554,7 +554,7 @@ export function collectStatsForNerdsSnapshot(): StatsForNerdsData {
publications: collectScreenShareAudioPublicationDiagnostics(localParticipant),
},
appInfo: {
- appVersion: Config.PUBLIC_BUILD_VERSION ?? 'dev',
+ appVersion: Config.BUILD_VERSION ?? 'dev',
electronVersion: null,
chromiumVersion: null,
hardwareAccelerationEnabled: null,
diff --git a/fluxer_desktop/electron-builder.config.cjs b/fluxer_desktop/electron-builder.config.cjs
index 4c3990d16..2597aa147 100644
--- a/fluxer_desktop/electron-builder.config.cjs
+++ b/fluxer_desktop/electron-builder.config.cjs
@@ -118,7 +118,10 @@ const legacyLinuxOptDirSweepScript = path.resolve(__dirname, 'packaging/linux/rp
const legacyLinuxOptDirRpmFpmArgs = isCanary ? ['--rpm-posttrans', legacyLinuxOptDirSweepScript] : [];
const macOSMinimumSystemVersion = '13.0';
const metadataName = isLinuxBuild ? linuxPackageName : packageName;
-const shellVersion = process.env.VERSION || readBundledRendererVersion();
+if (process.env.VERSION && !process.env.BUILD_VERSION) {
+ throw new Error('The desktop packaging no longer reads VERSION. Set BUILD_VERSION instead.');
+}
+const shellVersion = process.env.BUILD_VERSION || readBundledRendererVersion();
const supportedTargetArchs = ['x64', 'arm64'];
const supportedMacTargetArchs = [...supportedTargetArchs, 'universal'];
const electronArch = process.env.ELECTRON_ARCH;
diff --git a/fluxer_desktop/scripts/build.mjs b/fluxer_desktop/scripts/build.mjs
index 06ee6db41..fdd3b0b3b 100644
--- a/fluxer_desktop/scripts/build.mjs
+++ b/fluxer_desktop/scripts/build.mjs
@@ -44,16 +44,24 @@ const isProduction =
process.env.FLUXER_DESKTOP_PRODUCTION === 'true' ||
process.env.GITHUB_ACTIONS === 'true';
const skipNative = process.env.FLUXER_SKIP_NATIVE === 'true';
-let embeddedBuildVersion = process.env.PUBLIC_BUILD_VERSION || process.env.BUILD_VERSION || '';
-const embeddedReleaseChannel = process.env.PUBLIC_RELEASE_CHANNEL || process.env.RELEASE_CHANNEL || '';
+const RENAMED_BUILD_ENV = {
+ PUBLIC_BUILD_VERSION: 'BUILD_VERSION',
+ PUBLIC_RELEASE_CHANNEL: 'BUILD_CHANNEL',
+ RELEASE_CHANNEL: 'BUILD_CHANNEL',
+};
+for (const [oldName, newName] of Object.entries(RENAMED_BUILD_ENV)) {
+ if (process.env[oldName] && !process.env[newName]) {
+ throw new Error(`The desktop build no longer reads ${oldName}. Set ${newName} instead.`);
+ }
+}
+let embeddedBuildVersion = process.env.BUILD_VERSION || '';
+const embeddedBuildChannel = process.env.BUILD_CHANNEL || '';
const modulesEnabled = process.env.FLUXER_MODULES === '1' || process.env.FLUXER_MODULES === 'true';
const offlineBuild = process.env.FLUXER_OFFLINE === '1' || process.env.FLUXER_OFFLINE === 'true';
-function publicBuildDefines() {
+function buildInfoDefines() {
return {
- 'process.env.PUBLIC_BUILD_VERSION': JSON.stringify(embeddedBuildVersion),
'process.env.BUILD_VERSION': JSON.stringify(embeddedBuildVersion),
- 'process.env.PUBLIC_RELEASE_CHANNEL': JSON.stringify(embeddedReleaseChannel),
- 'process.env.RELEASE_CHANNEL': JSON.stringify(embeddedReleaseChannel),
+ 'process.env.BUILD_CHANNEL': JSON.stringify(embeddedBuildChannel),
'process.env.FLUXER_MODULES': JSON.stringify(modulesEnabled ? '1' : ''),
'process.env.FLUXER_OFFLINE': JSON.stringify(offlineBuild ? '1' : ''),
};
@@ -691,7 +699,7 @@ async function buildMain() {
define: {
'process.env.NODE_ENV': JSON.stringify(isProduction ? 'production' : 'development'),
[MAIN_APP_OUTPUT_FILE_DEFINE]: JSON.stringify(MAIN_APP_OUTPUT_FILE_NAME),
- ...publicBuildDefines(),
+ ...buildInfoDefines(),
},
banner: {
js: `import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);`,
@@ -860,7 +868,7 @@ function preloadBuildOptions(entryFileName, outputFileName) {
tsconfig: DESKTOP_TSCONFIG,
define: {
'process.env.NODE_ENV': JSON.stringify(isProduction ? 'production' : 'development'),
- ...publicBuildDefines(),
+ ...buildInfoDefines(),
},
};
}
@@ -1013,7 +1021,7 @@ function writeBuildInfo() {
`${JSON.stringify(
{
buildVersion: embeddedBuildVersion,
- releaseChannel: embeddedReleaseChannel,
+ releaseChannel: embeddedBuildChannel,
buildChannel: compiledBuildChannel,
offlineBuild,
modulesEnabled,
diff --git a/fluxer_desktop/src/main/DesktopDebugInfo.ts b/fluxer_desktop/src/main/DesktopDebugInfo.ts
index 9fd6bcf23..971515a3f 100644
--- a/fluxer_desktop/src/main/DesktopDebugInfo.ts
+++ b/fluxer_desktop/src/main/DesktopDebugInfo.ts
@@ -178,10 +178,8 @@ function formatSystemArchitecture(desktopInfo: DesktopInfo): string {
}
function getBuildString(desktopInfo: DesktopInfo): string {
- const buildVersion = process.env.PUBLIC_BUILD_VERSION || process.env.BUILD_VERSION || desktopInfo.version || 'dev';
- const releaseChannel = formatReleaseChannelLabel(
- process.env.PUBLIC_RELEASE_CHANNEL || process.env.RELEASE_CHANNEL || desktopInfo.channel,
- );
+ const buildVersion = process.env.BUILD_VERSION || desktopInfo.version || 'dev';
+ const releaseChannel = formatReleaseChannelLabel(process.env.BUILD_CHANNEL || desktopInfo.channel);
return `${releaseChannel} Desktop ${buildVersion}`;
}
diff --git a/tools/ci/src/app_proxy.rs b/tools/ci/src/app_proxy.rs
index 68c448cdd..7c005ffc7 100644
--- a/tools/ci/src/app_proxy.rs
+++ b/tools/ci/src/app_proxy.rs
@@ -536,7 +536,6 @@ mod tests {
fn resolves_calver_from_explicit_or_date_override() {
let explicit = CalverEnv {
build_version: Some("2026.520.1".to_string()),
- fluxer_build_version: Some("2026.521.2".to_string()),
fluxer_build_date: Some("2026-05-22T03:04:05Z".to_string()),
};
assert_eq!(
diff --git a/tools/ci/src/common.rs b/tools/ci/src/common.rs
index 6ce8731e0..de791ddec 100644
--- a/tools/ci/src/common.rs
+++ b/tools/ci/src/common.rs
@@ -33,7 +33,6 @@ pub(crate) const CALVER_SCHEME: &str = "YYYY.MDD.MICRO";
#[derive(Default)]
pub(crate) struct CalverEnv {
pub(crate) build_version: Option<String>,
- pub(crate) fluxer_build_version: Option<String>,
pub(crate) fluxer_build_date: Option<String>,
}
@@ -41,7 +40,6 @@ impl CalverEnv {
pub(crate) fn from_process() -> Self {
Self {
build_version: trim_option(env::var("BUILD_VERSION").ok()),
- fluxer_build_version: trim_option(env::var("FLUXER_BUILD_VERSION").ok()),
fluxer_build_date: trim_option(env::var("FLUXER_BUILD_DATE").ok()),
}
}
@@ -335,11 +333,7 @@ fn quote_arg(arg: &OsStr) -> String {
}
pub(crate) fn resolve_calver(calver_env: &CalverEnv, now: DateTime<Utc>) -> Result<String> {
- if let Some(version) = calver_env
- .build_version
- .as_deref()
- .or(calver_env.fluxer_build_version.as_deref())
- {
+ if let Some(version) = calver_env.build_version.as_deref() {
parse_version_instant(version)?;
return Ok(version.to_string());
}
diff --git a/tools/ci/src/desktop.rs b/tools/ci/src/desktop.rs
index 5e56269e9..d540d1b6f 100644
--- a/tools/ci/src/desktop.rs
+++ b/tools/ci/src/desktop.rs
@@ -211,7 +211,7 @@ pub async fn run(args: BuildDesktopArgs) -> Result<()> {
.channel
.clone()
.filter(|value| !value.is_empty())
- .or_else(|| env_string("CHANNEL"))
+ .or_else(|| env_string("BUILD_CHANNEL"))
.unwrap_or_else(|| "stable".to_string());
set_metadata_step(&channel)
}
@@ -233,7 +233,7 @@ pub async fn run(args: BuildDesktopArgs) -> Result<()> {
}
DesktopStep::UpdateVersion => run_command(pnpm_command()?.args([
"version",
- &require_env("VERSION")?,
+ &require_env("BUILD_VERSION")?,
"--no-git-tag-version",
"--allow-same-version",
])),
@@ -302,7 +302,6 @@ fn set_metadata_step(channel: &str) -> Result<()> {
append_github_output(&[
("version", version.as_str()),
("pub_date", pub_date.as_str()),
- ("channel", channel),
("build_channel", build_channel),
("source_sha", source_sha.as_str()),
])
@@ -2981,7 +2980,7 @@ fn windows_package_config(build_channel: &str, arch: &str) -> Result<WindowsPack
fn package_app_windows_velopack_step() -> Result<()> {
let build_channel = env::var("BUILD_CHANNEL").unwrap_or_else(|_| "stable".to_string());
let arch = require_env("ARCH")?;
- let version = require_env("VERSION")?;
+ let version = require_env("BUILD_VERSION")?;
let config = windows_package_config(&build_channel, &arch)?;
remove_dir_if_exists(&config.output_dir)?;
@@ -3377,7 +3376,7 @@ fn velopack_path_lengths(nupkg: &Path, prefix: &Path) -> Result<Vec<ArchivePathL
fn create_portable_zip_windows_step() -> Result<()> {
let build_channel = env::var("BUILD_CHANNEL").unwrap_or_else(|_| "stable".to_string());
let arch = require_env("ARCH")?;
- let version = require_env("VERSION")?;
+ let version = require_env("BUILD_VERSION")?;
let config = windows_package_config(&build_channel, &arch)?;
let Some(pack_dir) = find_windows_unpacked_app(&arch, &config.main_exe) else {
println!("No unpacked Windows app found; skipping portable ZIP.");
@@ -4314,7 +4313,7 @@ fn extract_zip_safely(archive_path: &Path, destination: &Path) -> Result<()> {
fn verify_windows_signed_artifacts_step() -> Result<()> {
let build_channel = env::var("BUILD_CHANNEL").unwrap_or_else(|_| "stable".to_string());
let arch = require_env("ARCH")?;
- let version = require_env("VERSION")?;
+ let version = require_env("BUILD_VERSION")?;
let config = windows_package_config(&build_channel, &arch)?;
let nupkg = first_file_matching(&config.output_dir, |name| name.ends_with("-full.nupkg"))
@@ -4584,8 +4583,8 @@ fn build_payload_step() -> Result<()> {
remove_dir_if_exists(&payload_root)?;
fs::create_dir_all(&payload_root)?;
- let channel = require_env("CHANNEL")?;
- let version = require_env("VERSION")?;
+ let channel = require_env("BUILD_CHANNEL")?;
+ let version = require_env("BUILD_VERSION")?;
let pub_date = require_env("PUB_DATE")?;
let artifacts = Path::new("artifacts");
let artifact_dirs = payload_artifact_dirs(artifacts, &channel)?;
@@ -4633,8 +4632,8 @@ fn build_payload_step() -> Result<()> {
}
fn prepare_release_assets_step() -> Result<()> {
- let channel = require_env("CHANNEL")?;
- let version = require_env("VERSION")?;
+ let channel = require_env("BUILD_CHANNEL")?;
+ let version = require_env("BUILD_VERSION")?;
let source_sha = require_env("SOURCE_SHA")?;
let product = desktop_release_product(&channel)?;
let payload_root = Path::new("payload_tree")
@@ -5513,8 +5512,8 @@ fn build_module_manifest_step() -> Result<()> {
"Missing {}, run the build_payload step first",
payload_root.display()
);
- let channel = require_env("CHANNEL")?;
- let build_version = require_env("VERSION")?;
+ let channel = require_env("BUILD_CHANNEL")?;
+ let build_version = require_env("BUILD_VERSION")?;
let pub_date = require_env("PUB_DATE")?;
let packed = read_packed_desktop_modules(&desktop_modules_dir(), &channel, &build_version)?;
let targets = desktop_module_manifest_targets(&payload_root, &channel)?;
@@ -6518,9 +6517,9 @@ fn channel_baseline_sha(
}
async fn check_shell_contract_step() -> Result<()> {
- let channel = require_env("CHANNEL")?;
+ let channel = require_env("BUILD_CHANNEL")?;
let source_sha = validate_full_sha("SOURCE_SHA", &require_env("SOURCE_SHA")?)?;
- let version = require_env("VERSION")?;
+ let version = require_env("BUILD_VERSION")?;
crate::common::parse_version_instant(&version)?;
let choice =
DesktopShellContractChoice::parse_input(&require_env(DESKTOP_SHELL_CONTRACT_ENV)?)?;
@@ -6686,8 +6685,8 @@ fn modules_only_channel_manifest(
}
fn build_modules_only_manifest_step() -> Result<()> {
- let channel = require_env("CHANNEL")?;
- let build_version = require_env("VERSION")?;
+ let channel = require_env("BUILD_CHANNEL")?;
+ let build_version = require_env("BUILD_VERSION")?;
let pub_date = require_env("PUB_DATE")?;
let modules_dir = desktop_modules_dir();
let contract = read_shell_contract(&channel)?.with_context(|| {
@@ -6747,8 +6746,8 @@ fn build_modules_only_manifest_step() -> Result<()> {
}
fn prepare_modules_release_assets_step() -> Result<()> {
- let channel = require_env("CHANNEL")?;
- let version = require_env("VERSION")?;
+ let channel = require_env("BUILD_CHANNEL")?;
+ let version = require_env("BUILD_VERSION")?;
let source_sha = require_env("SOURCE_SHA")?;
let product = desktop_release_product(&channel)?;
let payload_root = Path::new("payload_tree")
@@ -6787,9 +6786,8 @@ fn prepare_modules_release_assets_step() -> Result<()> {
fn build_summary_step() -> Result<()> {
let summary = require_env("GITHUB_STEP_SUMMARY")?;
- let display_channel = env::var("DISPLAY_CHANNEL").unwrap_or_default();
- let version = require_env("VERSION")?;
- let channel = require_env("CHANNEL")?;
+ let version = require_env("BUILD_VERSION")?;
+ let channel = require_env("BUILD_CHANNEL")?;
let mut file = OpenOptions::new()
.create(true)
.append(true)
@@ -6798,7 +6796,7 @@ fn build_summary_step() -> Result<()> {
writeln!(
file,
"## Desktop {} Release Assets Ready",
- title_case(&display_channel)
+ title_case(&channel)
)?;
writeln!(
file,
diff --git a/tools/dev/src/desktop.rs b/tools/dev/src/desktop.rs
index 9f577e6b0..35b6e82ee 100644
--- a/tools/dev/src/desktop.rs
+++ b/tools/dev/src/desktop.rs
@@ -272,11 +272,11 @@ fn ensure_renderer(rebuild: bool) -> Result<(PathBuf, String)> {
env: vec![
("NODE_ENV".to_owned(), Some("production".to_owned())),
(
- "PUBLIC_BUILD_VERSION".to_owned(),
+ "BUILD_VERSION".to_owned(),
Some(RENDERER_BUILD_VERSION.to_owned()),
),
(
- "PUBLIC_RELEASE_CHANNEL".to_owned(),
+ "BUILD_CHANNEL".to_owned(),
Some(DEVELOPMENT_CHANNEL.to_owned()),
),
],
@@ -374,12 +374,8 @@ pub fn build_desktop_shell() -> Result<()> {
Some(env::var("BUILD_CHANNEL").unwrap_or_else(|_| "canary".to_owned())),
),
(
- "PUBLIC_BUILD_VERSION".to_owned(),
- Some(env::var("PUBLIC_BUILD_VERSION").unwrap_or_else(|_| "dev".to_owned())),
- ),
- (
- "PUBLIC_RELEASE_CHANNEL".to_owned(),
- Some(env::var("PUBLIC_RELEASE_CHANNEL").unwrap_or_else(|_| "canary".to_owned())),
+ "BUILD_VERSION".to_owned(),
+ Some(env::var("BUILD_VERSION").unwrap_or_else(|_| "dev".to_owned())),
),
];
run_command(
@@ -459,16 +455,7 @@ pub fn build_desktop(
"FLUXER_DESKTOP_PRODUCTION".to_owned(),
Some("true".to_owned()),
),
- ("PUBLIC_BUILD_VERSION".to_owned(), Some(version.clone())),
("BUILD_VERSION".to_owned(), Some(version.clone())),
- (
- "PUBLIC_RELEASE_CHANNEL".to_owned(),
- Some(DEVELOPMENT_CHANNEL.to_owned()),
- ),
- (
- "RELEASE_CHANNEL".to_owned(),
- Some(DEVELOPMENT_CHANNEL.to_owned()),
- ),
("ELECTRON_ARCH".to_owned(), Some(arch)),
("WORKDIR".to_owned(), Some(ROOT.display().to_string())),
],
@@ -585,7 +572,7 @@ pub fn package_desktop(
"BUILD_CHANNEL".to_owned(),
Some(DEVELOPMENT_CHANNEL.to_owned()),
),
- ("VERSION".to_owned(), Some(version.clone())),
+ ("BUILD_VERSION".to_owned(), Some(version.clone())),
("ELECTRON_ARCH".to_owned(), Some(arch.clone())),
("NODE_ENV".to_owned(), Some("production".to_owned())),
];
diff --git a/tools/dev/src/desktop_modules.rs b/tools/dev/src/desktop_modules.rs
index c7ef8c635..1a69a88d8 100644
--- a/tools/dev/src/desktop_modules.rs
+++ b/tools/dev/src/desktop_modules.rs
@@ -214,8 +214,8 @@ fn stage_channel_manifest(
"WORKDIR".to_owned(),
Some(modules_workdir().display().to_string()),
),
- ("CHANNEL".to_owned(), Some(target.channel.clone())),
- ("VERSION".to_owned(), Some(stamp.version.clone())),
+ ("BUILD_CHANNEL".to_owned(), Some(target.channel.clone())),
+ ("BUILD_VERSION".to_owned(), Some(stamp.version.clone())),
("PUB_DATE".to_owned(), Some(stamp.pub_date.clone())),
("DESKTOP_MODULE_ONLY".to_owned(), Some("1".to_owned())),
("PLATFORM".to_owned(), Some(target.platform.clone())),