A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
feat(ci): publish build artifacts as GitHub releases (#1222)
Hampusa2ed83df0867
diff --git a/.github/workflows/_build-image.yaml b/.github/workflows/_build-image.yamlindex f88552fbc..ab6ad8093 100644--- a/.github/workflows/_build-image.yaml+++ b/.github/workflows/_build-image.yaml@@ -32,10 +32,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this image fragment is uploaded. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writedefaults:@@ -54,18 +59,18 @@ jobs:outputs:build_version: ${{ steps.vars.outputs.build_version }}steps:- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0env:GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: set variablesid: varsenv:GH_TOKEN: ${{ github.token }}- FLUXER_BUILD_VERSION: ${{ inputs.build-version }}+ FLUXER_BUILD_VERSION: ${{ inputs['build-version'] }}run: >-cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- resolve-calver--github-output@@ -85,16 +90,16 @@ jobs:- platform: arm64runner: blacksmith-4vcpu-ubuntu-2404-armsteps:- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0env:GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9+ - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5+ - uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915beewith:registry: ghcr.iousername: ${{ github.actor }}password: ${{ secrets.GITHUB_TOKEN }}- - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8+ - uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195bafwith:context: ${{ inputs.context }}file: ${{ inputs.dockerfile }}@@ -118,8 +123,15 @@ jobs:environment: buildstimeout-minutes: 10steps:- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5+ - uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915beewith:registry: ghcr.iousername: ${{ github.actor }}@@ -141,3 +153,54 @@ jobs:"${IMAGE}:${VERSION}-amd64" \"${IMAGE}:${VERSION}-arm64"docker buildx imagetools inspect "${IMAGE}:${VERSION}"++ - name: Write GitHub release image fragment+ env:+ GH_TOKEN: ${{ github.token }}+ IMAGE_REF: ghcr.io/${{ env.GHCR_OWNER }}/${{ inputs.image }}:${{ needs.meta.outputs.build_version }}+ VERSION: ${{ needs.meta.outputs.build_version }}+ MOVING_TAGS: ${{ inputs.moving-tags }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ publish-image+ --build-version "${VERSION}"+ --image "${{ inputs.image }}"+ --image-ref "${IMAGE_REF}"+ --moving-tags "${MOVING_TAGS}"+ - name: Upload GitHub release fragment+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a+ with:+ name: release-fragment-${{ inputs.image }}+ path: release-out/fragments/fluxer-release-fragment-image-${{ inputs.image }}.json+ if-no-files-found: error+ retention-days: 14++ finalise:+ name: finalise GitHub release+ if: ${{ inputs['finalise-release'] }}+ needs: [meta, merge]+ runs-on: ubuntu-24.04+ environment: builds+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Download GitHub release fragments+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ pattern: release-fragment-*+ path: release-out/fragments+ merge-multiple: true+ - name: finalise GitHub release+ env:+ GH_TOKEN: ${{ github.token }}+ VERSION: ${{ needs.meta.outputs.build_version }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ finalise+ --build-version "${VERSION}"diff --git a/.github/workflows/build-admin.yaml b/.github/workflows/build-admin.yamlindex 1396f3422..494056d03 100644--- a/.github/workflows/build-admin.yaml+++ b/.github/workflows/build-admin.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-admindockerfile: fluxer_admin/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-api.yaml b/.github/workflows/build-api.yamlindex fceaa4c9c..db7976622 100644--- a/.github/workflows/build-api.yaml+++ b/.github/workflows/build-api.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-apidockerfile: fluxer_api/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-app-proxy-self-hosted.yaml b/.github/workflows/build-app-proxy-self-hosted.yamlindex 38f009d2c..da50f09ae 100644--- a/.github/workflows/build-app-proxy-self-hosted.yaml+++ b/.github/workflows/build-app-proxy-self-hosted.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -29,5 +39,6 @@ jobs:image: fluxer-app-proxy-self-hosteddockerfile: fluxer_app_proxy/Dockerfilebuild-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}extra-build-args: |FLUXER_APP_PROXY_TIME_FREEZE_ENABLED=falsediff --git a/.github/workflows/build-app-proxy.yaml b/.github/workflows/build-app-proxy.yamlindex e49efb837..7e4016aac 100644--- a/.github/workflows/build-app-proxy.yaml+++ b/.github/workflows/build-app-proxy.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writeenv:@@ -34,11 +44,11 @@ jobs:outputs:build_version: ${{ steps.vars.outputs.build_version }}steps:- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0env:GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: set variables@@ -55,18 +65,18 @@ jobs:environment: buildstimeout-minutes: 45steps:- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0env:GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: prepare docker configrun: >-cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-app-proxy--step prepare_docker_config- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f+ - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5- name: configure ghcr authenv:GHCR_USERNAME: ${{ github.actor }}@@ -92,6 +102,13 @@ jobs:cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-app-proxy--step generate_asset_manifest+ - name: Upload asset manifest handoff+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a+ with:+ name: app-proxy-assets-manifest+ path: app-dist-output/dist/assets-manifest.txt+ if-no-files-found: error+- name: upload assets to S3 static bucketenv:AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}@@ -109,16 +126,16 @@ jobs:environment: buildstimeout-minutes: 60steps:- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0env:GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9+ - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5+ - uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915beewith:registry: ghcr.iousername: ${{ github.actor }}password: ${{ secrets.GITHUB_TOKEN }}- - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8+ - uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195bafwith:context: .file: fluxer_app_proxy/Dockerfile@@ -142,8 +159,20 @@ jobs:environment: buildstimeout-minutes: 10steps:- - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f- - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Download app-proxy asset manifest+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ name: app-proxy-assets-manifest+ path: release-input/app-proxy+ - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5+ - uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915beewith:registry: ghcr.iousername: ${{ github.actor }}@@ -163,3 +192,54 @@ jobs:"${IMAGE}@${amd64_digest}" \"${IMAGE}:${VERSION}-arm64"docker buildx imagetools inspect "${IMAGE}:${VERSION}"++ - name: Write GitHub release app-proxy fragment+ env:+ GH_TOKEN: ${{ github.token }}+ IMAGE_REF: ghcr.io/${{ env.GHCR_OWNER }}/fluxer-app-proxy:${{ needs.meta.outputs.build_version }}+ VERSION: ${{ needs.meta.outputs.build_version }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ publish-app-proxy+ --build-version "${VERSION}"+ --image fluxer-app-proxy+ --image-ref "${IMAGE_REF}"+ --moving-tags "v1,latest"+ --asset-manifest release-input/app-proxy/assets-manifest.txt+ - name: Upload GitHub release fragment+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a+ with:+ name: release-fragment-fluxer-app-proxy+ path: release-out/fragments/fluxer-release-fragment-app-proxy.json+ if-no-files-found: error+ retention-days: 14++ finalise:+ name: finalise GitHub release+ if: ${{ inputs['finalise-release'] != false }}+ needs: [meta, merge]+ runs-on: ubuntu-24.04+ environment: builds+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Download GitHub release fragments+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ pattern: release-fragment-*+ path: release-out/fragments+ merge-multiple: true+ - name: finalise GitHub release+ env:+ GH_TOKEN: ${{ github.token }}+ VERSION: ${{ needs.meta.outputs.build_version }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ finalise+ --build-version "${VERSION}"diff --git a/.github/workflows/build-desktop.yaml b/.github/workflows/build-desktop.yamlindex d76d14668..506242635 100644--- a/.github/workflows/build-desktop.yaml+++ b/.github/workflows/build-desktop.yaml@@ -26,7 +26,6 @@ on:required: falsedefault: ""type: string-permissions:contents: writeid-token: write@@ -57,12 +56,12 @@ jobs:source_sha: ${{ steps.meta.outputs.source_sha }}steps:- name: Checkout source- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:ref: main- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"@@ -92,10 +91,10 @@ jobs:windows_game_capture_arm64: ${{ steps.set-matrix.outputs.windows_game_capture_arm64 }}steps:- name: Checkout source- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"@@ -143,25 +142,25 @@ jobs:FLUXER_WINDOWS_GAME_CAPTURE_MODULE_ENABLED: ${{ matrix.desktop_variant == 'windows-game-capture' && 'true' || 'false' }}steps:- name: Checkout CI helpers- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:ref: ${{ needs.meta.outputs.source_sha }}path: _ci- name: Checkout source- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:ref: ${{ needs.meta.outputs.source_sha }}path: source- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: Set up Python (Windows)if: runner.os == 'Windows'- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1with:python-version: "3.13"@@ -188,7 +187,7 @@ jobs:--step set_workdir_unix- name: Set up Node.js- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: 24@@ -210,7 +209,7 @@ jobs:--step resolve_pnpm_store_unix- name: Cache pnpm store- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9with:path: ${{ env.PNPM_STORE_PATH }}key: ${{ runner.os }}-${{ matrix.arch }}-pnpm-store-${{ hashFiles('source/**/pnpm-lock.yaml') }}@@ -239,7 +238,7 @@ jobs:- name: Set up Rust toolchain (Unix)if: matrix.platform != 'windows'- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"targets: ${{ matrix.platform == 'macos' && (matrix.arch == 'arm64' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin') || (matrix.arch == 'arm64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu') }}@@ -294,7 +293,7 @@ jobs:- name: Set up .NET SDK (Windows)if: matrix.platform == 'windows'- uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2+ uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1with:dotnet-version: "8.0.x"@@ -430,10 +429,10 @@ jobs:enabled: ${{ steps.check.outputs.enabled }}steps:- name: Checkout source- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"@@ -485,12 +484,12 @@ jobs:desktop_variant: windows-game-capturesteps:- name: Checkout CI helpers- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:ref: ${{ needs.meta.outputs.source_sha }}- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"@@ -513,7 +512,7 @@ jobs:- name: Azure login for Artifact Signingif: steps.check_artifacts.outputs.found == 'true'- uses: azure/login@1384c340ab2dda50fed2bee3041d1d87018aa5e8+ uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43with:client-id: ${{ secrets.AZURE_CLIENT_ID }}tenant-id: ${{ secrets.AZURE_TENANT_ID }}@@ -521,7 +520,7 @@ jobs:- name: Sign Windows executables with Artifact Signingif: steps.check_artifacts.outputs.found == 'true'- uses: azure/artifact-signing-action@5289deff81257f39600de2188534e17b633ba835+ uses: azure/artifact-signing-action@c7ab2a863ab5f9a846ddb8265964877ef296ee82with:endpoint: ${{ secrets.AZURE_ARTIFACT_SIGNING_ENDPOINT }}signing-account-name: ${{ secrets.AZURE_ARTIFACT_SIGNING_ACCOUNT_NAME }}@@ -589,12 +588,12 @@ jobs:AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}steps:- name: Checkout source- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:ref: ${{ needs.meta.outputs.source_sha }}- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"@@ -626,6 +625,26 @@ jobs:cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-desktop--step build_summary+ - name: Write GitHub release desktop fragment+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ publish-desktop+ --build-version "${{ needs.meta.outputs.version }}"+ --channel "${{ needs.meta.outputs.build_channel }}"+ --test-build "${{ needs.meta.outputs.test_build }}"+ --s3-prefix "${{ needs.meta.outputs.s3_prefix }}"+ --payload-root s3_payload+ --source-sha "${{ needs.meta.outputs.source_sha }}"+ - name: Upload GitHub release fragment+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a+ with:+ name: release-fragment-desktop+ path: release-out/fragments/fluxer-release-fragment-desktop-${{ needs.meta.outputs.build_channel }}.json+ if-no-files-found: error+ retention-days: 14+- name: Notify canary desktop webhookif: ${{ success() && needs.meta.outputs.channel == 'canary' }}env:@@ -639,3 +658,38 @@ jobs:run: >-cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- build-desktop--step cleanup_handoff++ finalise_release:+ name: Finalise GitHub desktop release+ if: ${{ !failure() && !cancelled() && needs.meta.outputs.test_build != 'true' }}+ needs:+ - meta+ - upload+ runs-on: ubuntu-24.04-arm+ environment: desktop-releases+ timeout-minutes: 10+ steps:+ - name: Checkout source+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ with:+ ref: ${{ needs.meta.outputs.source_sha }}++ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Download GitHub release fragments+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ pattern: release-fragment-*+ path: release-out/fragments+ merge-multiple: true++ - name: Finalise GitHub desktop release+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ finalise+ --build-version "${{ needs.meta.outputs.version }}"+ --source-sha "${{ needs.meta.outputs.source_sha }}"diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yamlindex 3b657fe05..4770bc822 100644--- a/.github/workflows/build-docs.yaml+++ b/.github/workflows/build-docs.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -29,5 +39,6 @@ jobs:image: fluxer-docsdockerfile: fluxer_docs/Dockerfilecontext: fluxer_docs- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-gateway.yaml b/.github/workflows/build-gateway.yamlindex 0b2f8b6f7..41bec730a 100644--- a/.github/workflows/build-gateway.yaml+++ b/.github/workflows/build-gateway.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-gatewaydockerfile: fluxer_gateway/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-gifs.yaml b/.github/workflows/build-gifs.yamlindex a3252c4e5..fec5628ba 100644--- a/.github/workflows/build-gifs.yaml+++ b/.github/workflows/build-gifs.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-gifsdockerfile: fluxer_gifs/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-marketing.yaml b/.github/workflows/build-marketing.yamlindex 9174b777d..ad4420016 100644--- a/.github/workflows/build-marketing.yaml+++ b/.github/workflows/build-marketing.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-marketingdockerfile: fluxer_marketing/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-media-proxy.yaml b/.github/workflows/build-media-proxy.yamlindex 7ec5ef8e5..f84a68859 100644--- a/.github/workflows/build-media-proxy.yaml+++ b/.github/workflows/build-media-proxy.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-media-proxydockerfile: fluxer_media_proxy/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-messages.yaml b/.github/workflows/build-messages.yamlindex 6cd172dfd..641a88872 100644--- a/.github/workflows/build-messages.yaml+++ b/.github/workflows/build-messages.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-messagesdockerfile: fluxer_messages/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-snowflakes.yaml b/.github/workflows/build-snowflakes.yamlindex fb6eda775..ca049e39c 100644--- a/.github/workflows/build-snowflakes.yaml+++ b/.github/workflows/build-snowflakes.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-snowflakesdockerfile: fluxer_snowflakes/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-static.yaml b/.github/workflows/build-static.yamlindex ed5802181..ba38f82da 100644--- a/.github/workflows/build-static.yaml+++ b/.github/workflows/build-static.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-staticdockerfile: fluxer_static/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-unfurl.yaml b/.github/workflows/build-unfurl.yamlindex b490f6445..0425a541d 100644--- a/.github/workflows/build-unfurl.yaml+++ b/.github/workflows/build-unfurl.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-unfurldockerfile: fluxer_unfurl/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/build-users.yaml b/.github/workflows/build-users.yamlindex 2a1af881d..9a6946478 100644--- a/.github/workflows/build-users.yaml+++ b/.github/workflows/build-users.yaml@@ -9,6 +9,11 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: trueworkflow_call:inputs:build-version:@@ -16,10 +21,15 @@ on:type: stringrequired: falsedefault: ""+ finalise-release:+ description: "Publish the GitHub Release after this workflow completes. Set false when an orchestrator will finalise the release."+ type: boolean+ required: false+ default: truepermissions:actions: read- contents: read+ contents: writepackages: writejobs:@@ -28,5 +38,6 @@ jobs:with:image: fluxer-usersdockerfile: fluxer_users/Dockerfile- build-version: ${{ inputs.build-version }}+ build-version: ${{ inputs['build-version'] }}+ finalise-release: ${{ inputs['finalise-release'] != false }}secrets: inheritdiff --git a/.github/workflows/dart-sdk-validation.yaml b/.github/workflows/dart-sdk-validation.yamlindex d377cbcb7..cdcdfc4bf 100644--- a/.github/workflows/dart-sdk-validation.yaml+++ b/.github/workflows/dart-sdk-validation.yaml@@ -32,13 +32,13 @@ jobs:- name: Checkout fluxerif: steps.changes.outputs.openapi == 'true'- uses: actions/checkout@b9e0990d219a03df7633c93f6f005a8fecbcab22+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:persist-credentials: false- name: Checkout Dart SDKif: steps.changes.outputs.openapi == 'true'- uses: actions/checkout@b9e0990d219a03df7633c93f6f005a8fecbcab22+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:repository: fluxerapp/dart_sdkpath: dart_sdk@@ -46,7 +46,7 @@ jobs:- name: Setup Dartif: steps.changes.outputs.openapi == 'true'- uses: dart-lang/setup-dart@2bd11704788983a6a210731656d0042e2df8b2c1+ uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260with:sdk: stablediff --git a/.github/workflows/deploy-service.yaml b/.github/workflows/deploy-service.yamlindex 305be7323..c9339c135 100644--- a/.github/workflows/deploy-service.yaml+++ b/.github/workflows/deploy-service.yaml@@ -16,7 +16,6 @@ on:- marketing- media-proxy- gateway- - data-service- messages- search- snowflakes@@ -93,11 +92,11 @@ jobs:contents: readpackages: readsteps:- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0env:GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig- name: install helm- uses: azure/setup-helm@bf6a7d304bc2fdb57e0331155b7ebf2c504acf0a+ uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310- name: configure kubectlshell: bash@@ -196,17 +195,6 @@ jobs:SETS="--set-string gateway.image=${DEPLOY_IMAGE} --set-string gateway.tag=${TAG}"BUILD_PATHS="gateway";;- data-service)- DEPLOY_IMAGE="fluxer-data-service"- if [[ "$CHANNEL" == "stable" ]]; then- echo "::error::data-service stable in-place upgrades are blocked. Deploy channel=canary to create the standby color, mirror writes and invalidations through API grpc_standby_host_template, then promote shards through grpc_promoted_standby_shards."- exit 1- fi- RELEASE="fluxer-${SERVICE}-canary"- SETS="--set-string dataService.name=data-service-canary --set-string dataService.image=${DEPLOY_IMAGE} --set-string dataService.tag=${TAG} --set-string dataService.configSecret=fluxer-config-shared"- SETS="${SETS} --set-string dataService.rolloutRole=standby --set-string dataService.updateStrategy=RollingUpdate --set rolloutAdmission.enabled=false"- BUILD_PATHS="dataService"- ;;worker)if [[ "$CHANNEL" != "stable" ]]; thenecho "::error::Worker deployments are only supported on the stable lane."diff --git a/.github/workflows/finalise-release.yaml b/.github/workflows/finalise-release.yamlnew file mode 100644index 000000000..599d3bf46--- /dev/null+++ b/.github/workflows/finalise-release.yaml@@ -0,0 +1,51 @@+# SPDX-License-Identifier: AGPL-3.0-or-later+name: finalise release++on:+ workflow_dispatch:+ inputs:+ build-version:+ description: "Fluxer CalVer build version (YYYY.MDD.MICRO, UTC HHMMSS without leading zeroes)"+ type: string+ required: true+ fragment-run-id:+ description: "Workflow run id that produced the release-fragment-* artifacts"+ type: string+ required: true++permissions:+ actions: read+ contents: write++defaults:+ run:+ shell: bash++jobs:+ finalise:+ name: finalise GitHub release manifest+ runs-on: ubuntu-24.04+ environment: builds+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Download GitHub release fragments+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ gh run download "${{ inputs.fragment-run-id }}"+ --pattern "release-fragment-*"+ --dir release-out/fragments+ - name: Finalise release+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ finalise+ --build-version "${{ inputs.build-version }}"diff --git a/.github/workflows/i18n-source-sync.yaml b/.github/workflows/i18n-source-sync.yamlindex 42ad138d7..5bcb63217 100644--- a/.github/workflows/i18n-source-sync.yaml+++ b/.github/workflows/i18n-source-sync.yaml@@ -35,22 +35,22 @@ jobs:permission-pull-requests: write- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:token: ${{ steps.create-token.outputs.token }}fetch-depth: 0persist-credentials: false- name: Set up Rust toolchain- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: Install pnpm- uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271- name: Install Node.js- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: "24"cache: "pnpm"diff --git a/.github/workflows/i18n-weblate-pr.yaml b/.github/workflows/i18n-weblate-pr.yamlindex b2f879820..c75d1139a 100644--- a/.github/workflows/i18n-weblate-pr.yaml+++ b/.github/workflows/i18n-weblate-pr.yaml@@ -40,7 +40,7 @@ jobs:permission-pull-requests: write- name: Checkout Weblate branch- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0with:token: ${{ steps.create-token.outputs.token }}ref: ${{ env.WEBLATE_BRANCH }}@@ -48,15 +48,15 @@ jobs:persist-credentials: false- name: Set up Rust toolchain- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: Install pnpm- uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271- name: Install Node.js- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: "24"cache: "pnpm"diff --git a/.github/workflows/labeller.yaml b/.github/workflows/labeller.yamlindex 2b0f8a7e7..18cc6dfb5 100644--- a/.github/workflows/labeller.yaml+++ b/.github/workflows/labeller.yaml@@ -18,7 +18,7 @@ jobs:permission-pull-requests: write- name: Label pull request- uses: actions/labeler@e52e4fb63ed5cd0e07abaad9826b2a893ccb921f+ uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213with:repo-token: ${{ steps.create-token.outputs.token }}configuration-path: .github/labeller.yamldiff --git a/.github/workflows/release-all.yaml b/.github/workflows/release-all.yamlnew file mode 100644index 000000000..ae33ea334--- /dev/null+++ b/.github/workflows/release-all.yaml@@ -0,0 +1,260 @@+# SPDX-License-Identifier: AGPL-3.0-or-later+name: release all builds++on:+ workflow_dispatch:+ inputs:+ build-version:+ description: "Explicit Fluxer CalVer build version (YYYY.MDD.MICRO, UTC HHMMSS without leading zeroes) to use instead of automatic UTC clock allocation"+ type: string+ required: false+ default: ""++permissions:+ actions: read+ contents: write+ packages: write++defaults:+ run:+ shell: bash++concurrency:+ group: release-all-${{ inputs['build-version'] || github.run_id }}+ cancel-in-progress: false++jobs:+ meta:+ name: resolve metadata+ runs-on: ubuntu-24.04+ environment: builds+ timeout-minutes: 5+ outputs:+ build_version: ${{ steps.vars.outputs.build_version }}+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: set variables+ id: vars+ env:+ GH_TOKEN: ${{ github.token }}+ FLUXER_BUILD_VERSION: ${{ inputs['build-version'] }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- resolve-calver+ --github-output++ build_admin:+ needs: meta+ uses: ./.github/workflows/build-admin.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_api:+ needs: meta+ uses: ./.github/workflows/build-api.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_app_proxy:+ needs: meta+ uses: ./.github/workflows/build-app-proxy.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_app_proxy_self_hosted:+ needs: meta+ uses: ./.github/workflows/build-app-proxy-self-hosted.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_docs:+ needs: meta+ uses: ./.github/workflows/build-docs.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_gateway:+ needs: meta+ uses: ./.github/workflows/build-gateway.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_gifs:+ needs: meta+ uses: ./.github/workflows/build-gifs.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_marketing:+ needs: meta+ uses: ./.github/workflows/build-marketing.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_media_proxy:+ needs: meta+ uses: ./.github/workflows/build-media-proxy.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_messages:+ needs: meta+ uses: ./.github/workflows/build-messages.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_snowflakes:+ needs: meta+ uses: ./.github/workflows/build-snowflakes.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_static:+ needs: meta+ uses: ./.github/workflows/build-static.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_unfurl:+ needs: meta+ uses: ./.github/workflows/build-unfurl.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ build_users:+ needs: meta+ uses: ./.github/workflows/build-users.yaml+ with:+ build-version: ${{ needs.meta.outputs.build_version }}+ finalise-release: false+ secrets: inherit++ release_assets:+ name: package Helm/self-hosting+ if: ${{ !failure() && !cancelled() }}+ needs:+ - meta+ - build_admin+ - build_api+ - build_app_proxy+ - build_app_proxy_self_hosted+ - build_docs+ - build_gateway+ - build_gifs+ - build_marketing+ - build_media_proxy+ - build_messages+ - build_snowflakes+ - build_static+ - build_unfurl+ - build_users+ runs-on: ubuntu-24.04+ environment: builds+ timeout-minutes: 20+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Set up Helm+ uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310+ - name: Publish self-hosting bundle+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ publish-self-hosting+ --build-version "${{ needs.meta.outputs.build_version }}"+ - name: Publish Helm chart bundle+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ publish-helm+ --build-version "${{ needs.meta.outputs.build_version }}"+ - name: Upload release asset fragments+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a+ with:+ name: release-fragment-release-assets+ path: release-out/fragments/*.json+ if-no-files-found: error+ retention-days: 14++ finalise:+ name: finalise GitHub release manifest+ if: ${{ !failure() && !cancelled() }}+ needs:+ - meta+ - build_admin+ - build_api+ - build_app_proxy+ - build_app_proxy_self_hosted+ - build_docs+ - build_gateway+ - build_gifs+ - build_marketing+ - build_media_proxy+ - build_messages+ - build_snowflakes+ - build_static+ - build_unfurl+ - build_users+ - release_assets+ runs-on: ubuntu-24.04+ environment: builds+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0+ env:+ GIT_CONFIG_GLOBAL: ${{ runner.temp }}/gitconfig+ - name: Set up Rust toolchain (CI helpers)+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9+ with:+ toolchain: "1.93.0"+ - name: Download GitHub release fragments+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ pattern: release-fragment-*+ path: release-out/fragments+ merge-multiple: true+ - name: Finalise GitHub release manifest+ env:+ GH_TOKEN: ${{ github.token }}+ run: >-+ cargo run --locked --quiet --manifest-path tools/ci/Cargo.toml -- release+ finalise+ --build-version "${{ needs.meta.outputs.build_version }}"diff --git a/.github/workflows/repair-static-asset-metadata.yaml b/.github/workflows/repair-static-asset-metadata.yamlindex 8217832b0..697fce52c 100644--- a/.github/workflows/repair-static-asset-metadata.yaml+++ b/.github/workflows/repair-static-asset-metadata.yaml@@ -24,10 +24,10 @@ jobs:S3_ENDPOINT: https://ewr1.vultrobjects.comsteps:- name: Checkout repository- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust- uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: 1.93.0diff --git a/.github/workflows/sync-static-bucket.yaml b/.github/workflows/sync-static-bucket.yamlindex 89f8a434c..bf149e95e 100644--- a/.github/workflows/sync-static-bucket.yaml+++ b/.github/workflows/sync-static-bucket.yaml@@ -19,10 +19,10 @@ jobs:S3_WRITE_CONCURRENCY: 8steps:- name: Checkout repository- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust- uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: 1.93.0diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yamlindex d2523001f..9dfe1ddd6 100644--- a/.github/workflows/tests.yaml+++ b/.github/workflows/tests.yaml@@ -20,19 +20,19 @@ jobs:timeout-minutes: 25steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"targets: wasm32-unknown-unknown- name: Install pnpm- uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271- name: Install Node.js- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: '24'cache: 'pnpm'@@ -52,19 +52,19 @@ jobs:timeout-minutes: 25steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"targets: wasm32-unknown-unknown- name: Install pnpm- uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271- name: Install Node.js- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: '24'cache: 'pnpm'@@ -84,25 +84,25 @@ jobs:timeout-minutes: 30steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Install Rust toolchain- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: stablecomponents: clippy, rustfmt- name: Install pnpm- uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271- name: Install Node.js- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: '24'cache: 'pnpm'- name: Cache cargo- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9with:path: |~/.cargo/registry@@ -141,21 +141,21 @@ jobs:timeout-minutes: 25steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: Set up Erlang- uses: erlef/setup-beam@3559ac3b631a9560f28817e8e7fdde1638664336+ uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124with:otp-version: '28'rebar3-version: '3.24.0'- name: Cache rebar3 dependencies- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9with:path: |fluxer_gateway/_build@@ -189,19 +189,19 @@ jobs:timeout-minutes: 25steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"targets: wasm32-unknown-unknown- name: Install pnpm- uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271- name: Install Node.js- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041ewith:node-version: '24'cache: 'pnpm'@@ -221,10 +221,10 @@ jobs:timeout-minutes: 25steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Install Rust toolchain- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: stablecomponents: rustfmt@@ -244,15 +244,15 @@ jobs:timeout-minutes: 10steps:- name: Checkout code- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0- name: Set up Rust toolchain (CI helpers)- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b+ uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9with:toolchain: "1.93.0"- name: Install helm- uses: azure/setup-helm@bf6a7d304bc2fdb57e0331155b7ebf2c504acf0a+ uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310- name: Resolve Helm test build versionrun: >-@@ -309,7 +309,7 @@ jobs:*worker*)EXTRA_SETS+=(--set-string "workerRealtime.tag=${HELM_TEST_BUILD_VERSION}" --set-string "workerUnfurl.tag=${HELM_TEST_BUILD_VERSION}" --set-string "workerLifecycle.tag=${HELM_TEST_BUILD_VERSION}" --set-string "workerBatch.tag=${HELM_TEST_BUILD_VERSION}" --set-string "workerRealtime.build.version=${HELM_TEST_BUILD_VERSION}" --set-string "workerUnfurl.build.version=${HELM_TEST_BUILD_VERSION}" --set-string "workerLifecycle.build.version=${HELM_TEST_BUILD_VERSION}" --set-string "workerBatch.build.version=${HELM_TEST_BUILD_VERSION}");;- *gifs*|*member-lists*|*messages*|*presence*|*snowflakes*|*unfurl*|*users*|*voice-states*)+ *gifs*|*messages*|*snowflakes*|*unfurl*|*users*)EXTRA_SETS+=(--set-string "svc.tag=${HELM_TEST_BUILD_VERSION}" --set-string "svc.build.version=${HELM_TEST_BUILD_VERSION}" --set-string svc.build.channel=stable);;esacdiff --git a/deploy/helm/infra/templates/geoip-sync-cronjob.yaml b/deploy/helm/infra/templates/geoip-sync-cronjob.yamlindex feccbde29..8c7c47fa6 100644--- a/deploy/helm/infra/templates/geoip-sync-cronjob.yaml+++ b/deploy/helm/infra/templates/geoip-sync-cronjob.yaml@@ -1,8 +1,7 @@# SPDX-License-Identifier: AGPL-3.0-or-later## Daily sync of the MaxMind GeoLite2 City and ASN MMDB files into S3.-# The api reads these out of the CDN bucket at runtime to enrich-# request logs and the data-service for ratelimits. Adopted into helm+# Runtime services read these out of the CDN bucket. Adopted into helm# from a previously hand-applied kubectl manifest.apiVersion: batch/v1diff --git a/deploy/helm/infra/values.yaml b/deploy/helm/infra/values.yamlindex 2c5f4db13..15b3fd042 100644--- a/deploy/helm/infra/values.yaml+++ b/deploy/helm/infra/values.yaml@@ -78,8 +78,8 @@ ports:gateway: 8080uploads: 8080-# MaxMind GeoLite2 sync — daily at 05:17 UTC. The api + data-service-# read these mmdb files out of the CDN bucket at runtime.+# MaxMind GeoLite2 sync — daily at 05:17 UTC. Runtime services read+# these mmdb files out of the CDN bucket.geoipSync:image: amazon/aws-cli:2.17.12schedule: '17 5 * * *'diff --git a/deploy/helm/member-lists/Chart.yaml b/deploy/helm/member-lists/Chart.yamldeleted file mode 100644index 24c63cab8..000000000--- a/deploy/helm/member-lists/Chart.yaml+++ /dev/null@@ -1,9 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--apiVersion: v2-name: member-lists-version: 0.1.0-dependencies:- - name: svc-common- version: 0.1.0- repository: file://../svc-commondiff --git a/deploy/helm/member-lists/templates/all.yaml b/deploy/helm/member-lists/templates/all.yamldeleted file mode 100644index df5f0cc23..000000000--- a/deploy/helm/member-lists/templates/all.yaml+++ /dev/null@@ -1,11 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--{{ include "svc-common.statefulset" . }}-----{{ include "svc-common.deployment" . }}-----{{ include "svc-common.headless-service" . }}-----{{ include "svc-common.service" . }}-----{{ include "svc-common.pdb" . }}diff --git a/deploy/helm/member-lists/values.prod.yaml b/deploy/helm/member-lists/values.prod.yamldeleted file mode 100644index 141d5962f..000000000--- a/deploy/helm/member-lists/values.prod.yaml+++ /dev/null@@ -1,22 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--svc:- shard:- replicas: 4- resources:- requests:- cpu: 250m- memory: 512Mi- limits:- memory: 1Gi- router:- replicas: 3- resources:- requests:- cpu: 250m- memory: 128Mi- limits:- memory: 256Mi- cache:- maxEntries: 500000- ttlMs: 30000diff --git a/deploy/helm/member-lists/values.yaml b/deploy/helm/member-lists/values.yamldeleted file mode 100644index 0932ba54e..000000000--- a/deploy/helm/member-lists/values.yaml+++ /dev/null@@ -1,40 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--global:- namespace: fluxer- imagePullSecret: ghcr-pull-secret- registry: ""--svc:- name: member-lists- image: fluxer-member-lists- tag: ''- shard:- replicas: 4- port: 8090- resources:- requests:- cpu: 100m- memory: 256Mi- limits:- memory: 512Mi- router:- replicas: 2- port: 8090- resources:- requests:- cpu: 100m- memory: 64Mi- limits:- memory: 128Mi- nats:- url: nats://nats-core:4222- cache:- maxEntries: 100000- ttlMs: 30000- extraEnv: []- nodeSelector: {}- tolerations: []--pdb:- minAvailable: '50%'diff --git a/deploy/helm/presence/Chart.yaml b/deploy/helm/presence/Chart.yamldeleted file mode 100644index 81a62657a..000000000--- a/deploy/helm/presence/Chart.yaml+++ /dev/null@@ -1,9 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--apiVersion: v2-name: presence-version: 0.1.0-dependencies:- - name: svc-common- version: 0.1.0- repository: file://../svc-commondiff --git a/deploy/helm/presence/templates/all.yaml b/deploy/helm/presence/templates/all.yamldeleted file mode 100644index df5f0cc23..000000000--- a/deploy/helm/presence/templates/all.yaml+++ /dev/null@@ -1,11 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--{{ include "svc-common.statefulset" . }}-----{{ include "svc-common.deployment" . }}-----{{ include "svc-common.headless-service" . }}-----{{ include "svc-common.service" . }}-----{{ include "svc-common.pdb" . }}diff --git a/deploy/helm/presence/values.prod.yaml b/deploy/helm/presence/values.prod.yamldeleted file mode 100644index 1fcd66190..000000000--- a/deploy/helm/presence/values.prod.yaml+++ /dev/null@@ -1,22 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--svc:- shard:- replicas: 4- resources:- requests:- cpu: 250m- memory: 256Mi- limits:- memory: 512Mi- router:- replicas: 3- resources:- requests:- cpu: 250m- memory: 128Mi- limits:- memory: 256Mi- cache:- maxEntries: 500000- ttlMs: 30000diff --git a/deploy/helm/presence/values.yaml b/deploy/helm/presence/values.yamldeleted file mode 100644index 30d0187f1..000000000--- a/deploy/helm/presence/values.yaml+++ /dev/null@@ -1,40 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--global:- namespace: fluxer- imagePullSecret: ghcr-pull-secret- registry: ""--svc:- name: presence- image: fluxer-presence- tag: ''- shard:- replicas: 4- port: 8090- resources:- requests:- cpu: 100m- memory: 128Mi- limits:- memory: 256Mi- router:- replicas: 2- port: 8090- resources:- requests:- cpu: 100m- memory: 64Mi- limits:- memory: 128Mi- nats:- url: nats://nats-core:4222- cache:- maxEntries: 100000- ttlMs: 30000- extraEnv: []- nodeSelector: {}- tolerations: []--pdb:- minAvailable: '50%'diff --git a/deploy/helm/voice-states/Chart.yaml b/deploy/helm/voice-states/Chart.yamldeleted file mode 100644index 6e51bd4ed..000000000--- a/deploy/helm/voice-states/Chart.yaml+++ /dev/null@@ -1,9 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--apiVersion: v2-name: voice-states-version: 0.1.0-dependencies:- - name: svc-common- version: 0.1.0- repository: file://../svc-commondiff --git a/deploy/helm/voice-states/templates/all.yaml b/deploy/helm/voice-states/templates/all.yamldeleted file mode 100644index df5f0cc23..000000000--- a/deploy/helm/voice-states/templates/all.yaml+++ /dev/null@@ -1,11 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--{{ include "svc-common.statefulset" . }}-----{{ include "svc-common.deployment" . }}-----{{ include "svc-common.headless-service" . }}-----{{ include "svc-common.service" . }}-----{{ include "svc-common.pdb" . }}diff --git a/deploy/helm/voice-states/values.prod.yaml b/deploy/helm/voice-states/values.prod.yamldeleted file mode 100644index 1fcd66190..000000000--- a/deploy/helm/voice-states/values.prod.yaml+++ /dev/null@@ -1,22 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--svc:- shard:- replicas: 4- resources:- requests:- cpu: 250m- memory: 256Mi- limits:- memory: 512Mi- router:- replicas: 3- resources:- requests:- cpu: 250m- memory: 128Mi- limits:- memory: 256Mi- cache:- maxEntries: 500000- ttlMs: 30000diff --git a/deploy/helm/voice-states/values.yaml b/deploy/helm/voice-states/values.yamldeleted file mode 100644index f6368d891..000000000--- a/deploy/helm/voice-states/values.yaml+++ /dev/null@@ -1,40 +0,0 @@-# SPDX-License-Identifier: AGPL-3.0-or-later--global:- namespace: fluxer- imagePullSecret: ghcr-pull-secret- registry: ""--svc:- name: voice-states- image: fluxer-voice-states- tag: ''- shard:- replicas: 4- port: 8090- resources:- requests:- cpu: 100m- memory: 128Mi- limits:- memory: 256Mi- router:- replicas: 2- port: 8090- resources:- requests:- cpu: 100m- memory: 64Mi- limits:- memory: 128Mi- nats:- url: nats://nats-core:4222- cache:- maxEntries: 100000- ttlMs: 30000- extraEnv: []- nodeSelector: {}- tolerations: []--pdb:- minAvailable: '50%'diff --git a/fluxer_api/src/api/app/APILifecycle.ts b/fluxer_api/src/api/app/APILifecycle.tsindex 80426ee74..be19b2eee 100644--- a/fluxer_api/src/api/app/APILifecycle.ts+++ b/fluxer_api/src/api/app/APILifecycle.ts@@ -197,7 +197,7 @@ export function createInitializer(config: APIConfig, logger: ILogger): () => Prologger.error({error}, 'Failed to verify KV deletion queue state');throw error;}- logger.info('Initializing data-service search...');+ logger.info('Initializing search indexes...');let searchInitialized = false;try {await initializeSearch(getCacheService());diff --git a/fluxer_api/src/api/worker/tasks/IndexChannelMessages.ts b/fluxer_api/src/api/worker/tasks/IndexChannelMessages.tsindex d9ed91d69..177ce1ef1 100644--- a/fluxer_api/src/api/worker/tasks/IndexChannelMessages.ts+++ b/fluxer_api/src/api/worker/tasks/IndexChannelMessages.ts@@ -69,7 +69,7 @@ const indexChannelMessages: WorkerTaskHandler = async (payload) => {try {await Promise.all(searchServices.map((s) => s.refreshIndex()));} catch (error) {- Logger.warn({error}, 'Search refresh after bulk indexing failed; data-service will commit on idle');+ Logger.warn({error}, 'Search refresh after bulk indexing failed');}await kvClient.del(validated.completionKey);Logger.info({completionKey: validated.completionKey}, 'All channels indexed');diff --git a/tools/ci/src/common.rs b/tools/ci/src/common.rsindex 09c9bfbc6..2caa888b6 100644--- a/tools/ci/src/common.rs+++ b/tools/ci/src/common.rs@@ -15,7 +15,7 @@ use std::collections::{BTreeMap, BTreeSet};use std::env;use std::ffi::{OsStr, OsString};use std::fs::{self, OpenOptions};-use std::io::{self, Read, Write};+use std::io::{Read, Write};use std::path::{Path, PathBuf};use std::process::{Command, Stdio};use std::sync::Arc;@@ -24,6 +24,8 @@ use tokio::sync::Semaphore;use tokio::task::JoinSet;use walkdir::WalkDir;+pub(crate) use crate::functions::{remove_dir_if_exists, remove_file_if_exists};+const DEFAULT_S3_WRITE_CONCURRENCY: usize = 8;const DEFAULT_S3_RETRY_ATTEMPTS: u32 = 8;@@ -1484,22 +1486,6 @@ pub(crate) fn require_home() -> Result<PathBuf> {.context("HOME or USERPROFILE is required")}-pub(crate) fn remove_file_if_exists(path: &Path) -> Result<()> {- match fs::remove_file(path) {- Ok(()) => Ok(()),- Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),- Err(error) => Err(error).with_context(|| format!("Failed to remove {}", path.display())),- }-}--pub(crate) fn remove_dir_if_exists(path: &Path) -> Result<()> {- match fs::remove_dir_all(path) {- Ok(()) => Ok(()),- Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),- Err(error) => Err(error).with_context(|| format!("Failed to remove {}", path.display())),- }-}-pub(crate) fn copy_dir_contents(source: &Path, dest: &Path) -> Result<()> {for file in collect_files(source)? {let relative = file.strip_prefix(source)?;diff --git a/tools/ci/src/desktop.rs b/tools/ci/src/desktop.rsindex 9fdc551ce..46e252599 100644--- a/tools/ci/src/desktop.rs+++ b/tools/ci/src/desktop.rs@@ -9,6 +9,7 @@ use crate::common::{runner_temp, s3_client, title_case, trim_option, upload_directory_to_s3,upload_directory_to_s3_overwrite,};+use crate::functions::write_json_pretty;use anyhow::{Context, Result, anyhow, bail, ensure};use aws_sdk_s3::Client as S3Client;use chrono::{DateTime, Utc};@@ -3278,15 +3279,6 @@ fn sha256_file(path: &Path) -> Result<String> {Ok(hex::encode(hasher.finalize()))}-fn write_json_pretty<T: Serialize + ?Sized>(path: &Path, value: &T) -> Result<()> {- if let Some(parent) = path.parent() {- fs::create_dir_all(parent)- .with_context(|| format!("Failed to create {}", parent.display()))?;- }- let bytes = serde_json::to_vec_pretty(value)?;- fs::write(path, bytes).with_context(|| format!("Failed to write {}", path.display()))-}-fn print_directory(dir: &Path) -> Result<()> {if !dir.exists() {println!("{} does not exist", dir.display());diff --git a/tools/ci/src/functions.rs b/tools/ci/src/functions.rsnew file mode 100644index 000000000..d93e5e857--- /dev/null+++ b/tools/ci/src/functions.rs@@ -0,0 +1,77 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use anyhow::{Context, Result};+use serde::Serialize;+use std::fs;+use std::io;+use std::path::Path;++pub(crate) fn remove_file_if_exists(path: &Path) -> Result<()> {+ match fs::remove_file(path) {+ Ok(()) => Ok(()),+ Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),+ Err(error) => Err(error).with_context(|| format!("Failed to remove {}", path.display())),+ }+}++pub(crate) fn remove_dir_if_exists(path: &Path) -> Result<()> {+ match fs::remove_dir_all(path) {+ Ok(()) => Ok(()),+ Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),+ Err(error) => Err(error).with_context(|| format!("Failed to remove {}", path.display())),+ }+}++pub(crate) fn write_json_pretty<T: Serialize + ?Sized>(path: &Path, value: &T) -> Result<()> {+ if let Some(parent) = path.parent() {+ fs::create_dir_all(parent)+ .with_context(|| format!("Failed to create {}", parent.display()))?;+ }+ let mut bytes = serde_json::to_vec_pretty(value)?;+ bytes.push(b'\n');+ fs::write(path, bytes).with_context(|| format!("Failed to write {}", path.display()))+}++#[cfg(test)]+mod tests {+ use super::*;+ use serde_json::json;++ #[test]+ fn remove_file_if_exists_removes_files_and_ignores_missing_paths() {+ let temp = tempfile::tempdir().unwrap();+ let path = temp.path().join("artifact.txt");+ fs::write(&path, "artifact").unwrap();++ remove_file_if_exists(&path).unwrap();+ remove_file_if_exists(&path).unwrap();++ assert!(!path.exists());+ }++ #[test]+ fn remove_dir_if_exists_removes_directories_and_ignores_missing_paths() {+ let temp = tempfile::tempdir().unwrap();+ let path = temp.path().join("dist");+ fs::create_dir_all(path.join("nested")).unwrap();+ fs::write(path.join("nested").join("artifact.txt"), "artifact").unwrap();++ remove_dir_if_exists(&path).unwrap();+ remove_dir_if_exists(&path).unwrap();++ assert!(!path.exists());+ }++ #[test]+ fn write_json_pretty_creates_parent_directories_and_writes_pretty_json() {+ let temp = tempfile::tempdir().unwrap();+ let path = temp.path().join("nested").join("manifest.json");++ write_json_pretty(&path, &json!({ "name": "fluxer", "version": 1 })).unwrap();++ assert_eq!(+ fs::read_to_string(path).unwrap(),+ "{\n \"name\": \"fluxer\",\n \"version\": 1\n}\n"+ );+ }+}diff --git a/tools/ci/src/lib.rs b/tools/ci/src/lib.rsindex 5bbdf70f6..150209544 100644--- a/tools/ci/src/lib.rs+++ b/tools/ci/src/lib.rs@@ -8,7 +8,9 @@ mod ci_workflow;mod common;mod desktop;mod desktop_native;+mod functions;mod gateway;+mod release;mod schema;mod static_bucket;@@ -37,6 +39,7 @@ enum Command {CleanSchemaGeneratedFiles(schema::CleanSchemaGeneratedFilesArgs),Gateway(gateway::GatewayArgs),RepairStaticAssetMetadata(static_bucket::RepairStaticAssetMetadataArgs),+ Release(release::ReleaseArgs),ResolveCalver(calver::ResolveCalverArgs),SyncStaticBucket(static_bucket::SyncStaticBucketArgs),TestWebrtcSenderRust(desktop_native::TestWebrtcSenderRustArgs),@@ -60,6 +63,7 @@ pub async fn run() -> Result<()> {Command::RepairStaticAssetMetadata(args) => {static_bucket::repair_asset_metadata(args).await}+ Command::Release(args) => release::run(args).await,Command::ResolveCalver(args) => calver::run(args),Command::SyncStaticBucket(args) => static_bucket::run(args).await,Command::TestWebrtcSenderRust(args) => desktop_native::run_test_webrtc_sender_rust(args),diff --git a/tools/ci/src/release.rs b/tools/ci/src/release.rsnew file mode 100644index 000000000..54645acb7--- /dev/null+++ b/tools/ci/src/release.rs@@ -0,0 +1,1058 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use crate::common::{CommandSpec, output_text, parse_version_instant, run_command};+use crate::functions::{remove_dir_if_exists, write_json_pretty};+use anyhow::{Context, Result, anyhow, ensure};+use chrono::Utc;+use clap::{ArgAction, Args, Subcommand};+use flate2::Compression;+use flate2::write::GzEncoder;+use serde::{Deserialize, Serialize};+use serde_json::{Value, json};+use sha2::{Digest as _, Sha256};+use std::collections::{BTreeMap, BTreeSet};+use std::env;+use std::fs::{self, File};+use std::io::{self, Read};+use std::path::{Path, PathBuf};+use tar::{Builder, Header};+use tempfile::tempdir;+use walkdir::WalkDir;++const RELEASE_SCHEMA_VERSION: u32 = 1;+const RELEASE_MANIFEST_FILENAME: &str = "fluxer-release-manifest.json";+const RELEASE_FRAGMENT_FILENAME_PREFIX: &str = "fluxer-release-fragment-";+const DEFAULT_RELEASE_OUTPUT_DIR: &str = "release-out";++const SELF_HOSTED_IMAGE_COMPONENTS: &[&str] = &[+ "fluxer-admin",+ "fluxer-api",+ "fluxer-app-proxy-self-hosted",+ "fluxer-gateway",+ "fluxer-gifs",+ "fluxer-media-proxy",+ "fluxer-messages",+ "fluxer-snowflakes",+ "fluxer-static",+ "fluxer-unfurl",+ "fluxer-users",+];++#[derive(Debug, Args, Clone)]+pub struct ReleaseArgs {+ #[command(subcommand)]+ command: ReleaseCommand,+}++#[derive(Debug, Subcommand, Clone)]+#[clap(rename_all = "kebab_case")]+enum ReleaseCommand {+ PublishImage(PublishImageArgs),+ PublishAppProxy(PublishAppProxyArgs),+ PublishDesktop(PublishDesktopArgs),+ PublishHelm(PublishHelmArgs),+ PublishSelfHosting(PublishSelfHostingArgs),+ Finalise(FinaliseArgs),+}++#[derive(Debug, Args, Clone)]+pub struct PublishImageArgs {+ #[arg(long)]+ build_version: String,+ #[arg(long)]+ image: String,+ #[arg(long)]+ image_ref: Option<String>,+ #[arg(long)]+ digest: Option<String>,+ #[arg(long, default_value = "v1,latest")]+ moving_tags: String,+ #[arg(long)]+ source_sha: Option<String>,+}++#[derive(Debug, Args, Clone)]+pub struct PublishAppProxyArgs {+ #[command(flatten)]+ image: PublishImageArgs,+ #[arg(long)]+ asset_manifest: Option<PathBuf>,+}++#[derive(Debug, Args, Clone)]+pub struct PublishDesktopArgs {+ #[arg(long)]+ build_version: String,+ #[arg(long)]+ channel: String,+ #[arg(long, action = ArgAction::Set)]+ test_build: bool,+ #[arg(long)]+ s3_prefix: String,+ #[arg(long, default_value = "s3_payload")]+ payload_root: PathBuf,+ #[arg(long)]+ source_sha: Option<String>,+}++#[derive(Debug, Args, Clone)]+pub struct PublishHelmArgs {+ #[arg(long)]+ build_version: String,+ #[arg(long, default_value = DEFAULT_RELEASE_OUTPUT_DIR)]+ output_dir: PathBuf,+ #[arg(long)]+ source_sha: Option<String>,+}++#[derive(Debug, Args, Clone)]+pub struct PublishSelfHostingArgs {+ #[arg(long)]+ build_version: String,+ #[arg(long, default_value = DEFAULT_RELEASE_OUTPUT_DIR)]+ output_dir: PathBuf,+ #[arg(long)]+ source_sha: Option<String>,+}++#[derive(Debug, Args, Clone)]+pub struct FinaliseArgs {+ #[arg(long)]+ build_version: String,+ #[arg(long, default_value = DEFAULT_RELEASE_OUTPUT_DIR)]+ output_dir: PathBuf,+ #[arg(long)]+ source_sha: Option<String>,+}++pub async fn run(args: ReleaseArgs) -> Result<()> {+ match args.command {+ ReleaseCommand::PublishImage(args) => publish_image(args).await,+ ReleaseCommand::PublishAppProxy(args) => publish_app_proxy(args).await,+ ReleaseCommand::PublishDesktop(args) => publish_desktop(args).await,+ ReleaseCommand::PublishHelm(args) => publish_helm(args).await,+ ReleaseCommand::PublishSelfHosting(args) => publish_self_hosting(args).await,+ ReleaseCommand::Finalise(args) => finalise(args).await,+ }+}++async fn publish_image(args: PublishImageArgs) -> Result<()> {+ let version = validate_build_version(&args.build_version)?;+ let image_ref = args+ .image_ref+ .clone()+ .unwrap_or_else(|| format!("{}:{version}", args.image));+ let digest = match args+ .digest+ .as_deref()+ .map(str::trim)+ .filter(|v| !v.is_empty())+ {+ Some(digest) => digest.to_string(),+ None => inspect_image_digest(&image_ref)?,+ };+ let source_sha = resolve_source_sha(args.source_sha.as_deref())?;+ let moving_tags = parse_csv(&args.moving_tags);+ let fragment = image_fragment(+ &version,+ &source_sha,+ &args.image,+ &image_ref,+ &digest,+ moving_tags,+ );+ let fragment_path = write_fragment(+ &fragment_filename(&format!("image-{}", sanitize_asset_segment(&args.image))),+ &fragment,+ )?;+ publish_fragment(&version, &source_sha, false, true, &[])?;+ println!("Wrote release fragment: {}", fragment_path.display());+ Ok(())+}++async fn publish_app_proxy(args: PublishAppProxyArgs) -> Result<()> {+ let version = validate_build_version(&args.image.build_version)?;+ let image_ref = args+ .image+ .image_ref+ .clone()+ .unwrap_or_else(|| format!("{}:{version}", args.image.image));+ let digest = match args+ .image+ .digest+ .as_deref()+ .map(str::trim)+ .filter(|v| !v.is_empty())+ {+ Some(digest) => digest.to_string(),+ None => inspect_image_digest(&image_ref)?,+ };+ let source_sha = resolve_source_sha(args.image.source_sha.as_deref())?;+ let moving_tags = parse_csv(&args.image.moving_tags);+ let static_assets = match args.asset_manifest.as_deref() {+ Some(path) => Some(static_asset_manifest(path)?),+ None => None,+ };+ let fragment = json!({+ "schemaVersion": RELEASE_SCHEMA_VERSION,+ "kind": "app-proxy",+ "version": version,+ "sourceSha": source_sha,+ "image": image_payload(&args.image.image, &image_ref, &digest, moving_tags),+ "staticAssets": static_assets,+ "workflow": workflow_payload(),+ });+ let fragment_path = write_fragment(&fragment_filename("app-proxy"), &fragment)?;+ publish_fragment(&version, &source_sha, false, true, &[])?;+ println!("Wrote release fragment: {}", fragment_path.display());+ Ok(())+}++async fn publish_desktop(args: PublishDesktopArgs) -> Result<()> {+ let version = validate_build_version(&args.build_version)?;+ let source_sha = resolve_source_sha(args.source_sha.as_deref())?;+ let payload_dir = args.payload_root.join(&args.s3_prefix);+ ensure!(+ payload_dir.is_dir(),+ "Desktop payload directory does not exist: {}",+ payload_dir.display()+ );+ let output_dir = release_output_dir().join("desktop");+ fs::create_dir_all(&output_dir)+ .with_context(|| format!("Failed to create {}", output_dir.display()))?;+ let bundle_name = format!(+ "fluxer-desktop-{}-{version}.tar.gz",+ sanitize_asset_segment(&args.channel)+ );+ let bundle_path = output_dir.join(&bundle_name);+ create_tar_gz(+ &bundle_path,+ &payload_dir,+ &format!("fluxer-desktop-{version}"),+ )?;+ let manifests = collect_payload_manifests(&payload_dir)?;+ let fragment = json!({+ "schemaVersion": RELEASE_SCHEMA_VERSION,+ "kind": "desktop",+ "version": version,+ "sourceSha": source_sha,+ "channel": args.channel,+ "testBuild": args.test_build,+ "s3Prefix": args.s3_prefix,+ "payloadRoot": path_to_slash_string(&payload_dir),+ "bundle": file_payload(&bundle_path)?,+ "manifests": manifests,+ "workflow": workflow_payload(),+ });+ let fragment_path = write_fragment(+ &fragment_filename(&format!(+ "desktop-{}",+ sanitize_asset_segment(&args.channel)+ )),+ &fragment,+ )?;+ publish_fragment(+ &version,+ &source_sha,+ args.channel == "canary" || args.test_build,+ true,+ &[bundle_path],+ )?;+ println!("Wrote release fragment: {}", fragment_path.display());+ Ok(())+}++async fn publish_helm(args: PublishHelmArgs) -> Result<()> {+ let version = validate_build_version(&args.build_version)?;+ let source_sha = resolve_source_sha(args.source_sha.as_deref())?;+ let output_dir = args.output_dir.join("helm");+ remove_dir_if_exists(&output_dir)?;+ fs::create_dir_all(&output_dir)+ .with_context(|| format!("Failed to create {}", output_dir.display()))?;++ let chart_dirs = helm_chart_dirs(Path::new("deploy/helm"))?;+ for chart_dir in &chart_dirs {+ run_command(+ CommandSpec::new("helm")+ .args(["dependency", "update"])+ .arg(chart_dir),+ )?;+ run_command(+ CommandSpec::new("helm")+ .arg("package")+ .arg(chart_dir)+ .args(["--version", &version])+ .args(["--app-version", &version])+ .arg("--destination")+ .arg(&output_dir),+ )?;+ }++ let mut charts = Vec::new();+ let mut assets = Vec::new();+ for path in sorted_files(&output_dir)? {+ if path.extension().and_then(|ext| ext.to_str()) != Some("tgz") {+ continue;+ }+ charts.push(file_payload(&path)?);+ assets.push(path);+ }+ ensure!(!charts.is_empty(), "No Helm chart packages were generated");++ let fragment = json!({+ "schemaVersion": RELEASE_SCHEMA_VERSION,+ "kind": "helm",+ "version": version,+ "sourceSha": source_sha,+ "charts": charts,+ "workflow": workflow_payload(),+ });+ let fragment_path = write_fragment(&fragment_filename("helm"), &fragment)?;+ publish_fragment(&version, &source_sha, false, true, &assets)?;+ println!("Wrote release fragment: {}", fragment_path.display());+ Ok(())+}++async fn publish_self_hosting(args: PublishSelfHostingArgs) -> Result<()> {+ let version = validate_build_version(&args.build_version)?;+ let source_sha = resolve_source_sha(args.source_sha.as_deref())?;+ let output_dir = args.output_dir.join("self-hosting");+ fs::create_dir_all(&output_dir)+ .with_context(|| format!("Failed to create {}", output_dir.display()))?;+ let bundle_path = output_dir.join(format!("fluxer-self-hosting-{version}.tar.gz"));+ create_self_hosting_bundle(&bundle_path, &version)?;+ let fragment = json!({+ "schemaVersion": RELEASE_SCHEMA_VERSION,+ "kind": "self-hosting",+ "version": version,+ "sourceSha": source_sha,+ "bundle": file_payload(&bundle_path)?,+ "images": self_hosting_images(&version),+ "workflow": workflow_payload(),+ });+ let fragment_path = write_fragment(&fragment_filename("self-hosting"), &fragment)?;+ publish_fragment(&version, &source_sha, true, true, &[bundle_path])?;+ println!("Wrote release fragment: {}", fragment_path.display());+ Ok(())+}++async fn finalise(args: FinaliseArgs) -> Result<()> {+ let version = validate_build_version(&args.build_version)?;+ let source_sha = resolve_source_sha(args.source_sha.as_deref())?;+ ensure_release(&version, &source_sha, false, true)?;++ let fragments_dir = args.output_dir.join("fragments");+ let fragments = read_fragments(&fragments_dir)?;+ ensure!(+ !fragments.is_empty(),+ "No release fragments found in {} for {}",+ fragments_dir.display(),+ release_tag(&version)+ );+ let manifest = build_manifest(&version, &source_sha, fragments);+ let manifest_path = args.output_dir.join(RELEASE_MANIFEST_FILENAME);+ write_json_pretty(&manifest_path, &manifest)?;+ let notes_path = args.output_dir.join("fluxer-release-notes.md");+ fs::write(¬es_path, release_notes(&manifest))+ .with_context(|| format!("Failed to write {}", notes_path.display()))?;++ upload_release_assets(&version, &[manifest_path])?;+ publish_release(&version, ¬es_path)+}++fn image_fragment(+ version: &str,+ source_sha: &str,+ image: &str,+ image_ref: &str,+ digest: &str,+ moving_tags: Vec<String>,+) -> Value {+ json!({+ "schemaVersion": RELEASE_SCHEMA_VERSION,+ "kind": "image",+ "version": version,+ "sourceSha": source_sha,+ "image": image_payload(image, image_ref, digest, moving_tags),+ "workflow": workflow_payload(),+ })+}++fn image_payload(image: &str, image_ref: &str, digest: &str, moving_tags: Vec<String>) -> Value {+ json!({+ "name": image,+ "ref": image_ref,+ "digest": digest,+ "digestRef": digest_ref(image_ref, digest),+ "movingTags": moving_tags,+ })+}++fn digest_ref(image_ref: &str, digest: &str) -> String {+ let image = image_ref+ .split_once(':')+ .map(|(image, _)| image)+ .unwrap_or(image_ref);+ format!("{image}@{digest}")+}++fn static_asset_manifest(path: &Path) -> Result<Value> {+ let text =+ fs::read_to_string(path).with_context(|| format!("Failed to read {}", path.display()))?;+ let assets = text+ .lines()+ .map(str::trim)+ .filter(|line| !line.is_empty())+ .map(ToOwned::to_owned)+ .collect::<Vec<_>>();+ Ok(json!({+ "filename": file_name(path)?,+ "assetCount": assets.len(),+ "sha256": sha256_file(path)?,+ }))+}++fn inspect_image_digest(image_ref: &str) -> Result<String> {+ let manifest = output_text(+ CommandSpec::new("docker")+ .args(["buildx", "imagetools", "inspect", image_ref])+ .args(["--format", "{{json .Manifest}}"]),+ )?;+ let value: Value = serde_json::from_str(&manifest)+ .with_context(|| format!("Failed to parse docker manifest for {image_ref}"))?;+ value+ .get("digest")+ .and_then(Value::as_str)+ .map(ToOwned::to_owned)+ .ok_or_else(|| anyhow!("Docker manifest for {image_ref} did not include a digest"))+}++fn publish_fragment(+ version: &str,+ source_sha: &str,+ prerelease: bool,+ draft: bool,+ assets: &[PathBuf],+) -> Result<()> {+ ensure_release(version, source_sha, prerelease, draft)?;+ upload_release_assets(version, assets)+}++fn ensure_release(version: &str, source_sha: &str, prerelease: bool, draft: bool) -> Result<()> {+ let tag = release_tag(version);+ if release_exists(&tag) {+ return Ok(());+ }++ let notes = format!(+ "Source: `{source_sha}`\n\nRelease manifest will be attached after finalisation.\n"+ );+ let notes_dir = tempdir()?;+ let notes_file = notes_dir.path().join("notes.md");+ fs::write(¬es_file, notes)+ .with_context(|| format!("Failed to write {}", notes_file.display()))?;+ let mut command = CommandSpec::new("gh")+ .args(["release", "create", &tag])+ .args(["--title", &release_title(version)])+ .args(["--latest=false"])+ .arg("--notes-file")+ .arg(¬es_file)+ .args(["--target", source_sha]);+ if prerelease {+ command = command.arg("--prerelease");+ }+ if draft {+ command = command.arg("--draft");+ }+ match run_command(command) {+ Ok(()) => Ok(()),+ Err(error) if release_exists(&tag) => {+ eprintln!(+ "Release {tag} was created concurrently; continuing. Original error: {error:#}"+ );+ Ok(())+ }+ Err(error) => Err(error),+ }+}++fn release_exists(tag: &str) -> bool {+ crate::common::command_succeeds(CommandSpec::new("gh").args(["release", "view", tag]))+}++fn upload_release_assets(version: &str, assets: &[PathBuf]) -> Result<()> {+ if assets.is_empty() {+ return Ok(());+ }+ let mut command = CommandSpec::new("gh")+ .args(["release", "upload", &release_tag(version)])+ .args(["--clobber"]);+ for asset in assets {+ ensure!(+ asset.is_file(),+ "Release asset is missing: {}",+ asset.display()+ );+ command = command.arg(asset);+ }+ run_command(command)+}++fn publish_release(version: &str, notes_path: &Path) -> Result<()> {+ let tag = release_tag(version);+ let release_id = output_text(+ CommandSpec::new("gh")+ .arg("api")+ .arg(format!("repos/{{owner}}/{{repo}}/releases/tags/{tag}"))+ .args(["--jq", ".id"]),+ )?;+ let payload_dir = tempdir()?;+ let payload_path = payload_dir.path().join("release-update.json");+ write_json_pretty(+ &payload_path,+ &json!({+ "body": fs::read_to_string(notes_path)+ .with_context(|| format!("Failed to read {}", notes_path.display()))?,+ "draft": false,+ "make_latest": "false",+ }),+ )?;+ run_command(+ CommandSpec::new("gh")+ .args(["api", "-X", "PATCH"])+ .arg(format!("repos/{{owner}}/{{repo}}/releases/{release_id}"))+ .arg("--input")+ .arg(&payload_path),+ )+}++fn write_fragment(name: &str, value: &Value) -> Result<PathBuf> {+ let dir = release_output_dir().join("fragments");+ fs::create_dir_all(&dir).with_context(|| format!("Failed to create {}", dir.display()))?;+ let path = dir.join(name);+ write_json_pretty(&path, value)?;+ Ok(path)+}++fn fragment_filename(name: &str) -> String {+ format!("{RELEASE_FRAGMENT_FILENAME_PREFIX}{name}.json")+}++fn release_output_dir() -> PathBuf {+ env::var("RELEASE_OUTPUT_DIR")+ .map(PathBuf::from)+ .unwrap_or_else(|_| PathBuf::from(DEFAULT_RELEASE_OUTPUT_DIR))+}++fn validate_build_version(version: &str) -> Result<String> {+ parse_version_instant(version)?;+ Ok(version.to_string())+}++fn release_tag(version: &str) -> String {+ version.to_string()+}++fn release_title(version: &str) -> String {+ release_tag(version)+}++fn resolve_source_sha(value: Option<&str>) -> Result<String> {+ value+ .map(str::trim)+ .filter(|value| !value.is_empty())+ .map(ToOwned::to_owned)+ .or_else(|| env::var("GITHUB_SHA").ok())+ .or_else(|| output_text(CommandSpec::new("git").args(["rev-parse", "HEAD"])).ok())+ .ok_or_else(|| anyhow!("Unable to resolve source SHA"))+}++fn workflow_payload() -> Value {+ json!({+ "repository": env::var("GITHUB_REPOSITORY").ok(),+ "workflow": env::var("GITHUB_WORKFLOW").ok(),+ "runId": env::var("GITHUB_RUN_ID").ok(),+ "runAttempt": env::var("GITHUB_RUN_ATTEMPT").ok(),+ "serverUrl": env::var("GITHUB_SERVER_URL").ok(),+ })+}++fn parse_csv(value: &str) -> Vec<String> {+ value+ .split(',')+ .map(str::trim)+ .filter(|value| !value.is_empty())+ .map(ToOwned::to_owned)+ .collect()+}++fn file_payload(path: &Path) -> Result<Value> {+ Ok(json!({+ "filename": file_name(path)?,+ "sha256": sha256_file(path)?,+ "bytes": fs::metadata(path)+ .with_context(|| format!("Failed to stat {}", path.display()))?+ .len(),+ }))+}++fn file_name(path: &Path) -> Result<String> {+ path.file_name()+ .and_then(|value| value.to_str())+ .map(ToOwned::to_owned)+ .ok_or_else(|| anyhow!("Invalid file name: {}", path.display()))+}++fn sha256_file(path: &Path) -> Result<String> {+ let mut file =+ File::open(path).with_context(|| format!("Failed to open {}", path.display()))?;+ let mut hasher = Sha256::new();+ let mut buffer = [0_u8; 64 * 1024];+ loop {+ let read = file+ .read(&mut buffer)+ .with_context(|| format!("Failed to read {}", path.display()))?;+ if read == 0 {+ break;+ }+ hasher.update(&buffer[..read]);+ }+ Ok(hex::encode(hasher.finalize()))+}++fn collect_payload_manifests(payload_dir: &Path) -> Result<Vec<Value>> {+ let mut manifests = Vec::new();+ for path in sorted_files(payload_dir)? {+ if path.file_name().and_then(|value| value.to_str()) != Some("manifest.json") {+ continue;+ }+ let relative = path+ .strip_prefix(payload_dir)+ .with_context(|| format!("Failed to relativize {}", path.display()))?;+ manifests.push(json!({+ "path": path_to_slash_string(relative),+ "sha256": sha256_file(&path)?,+ }));+ }+ Ok(manifests)+}++fn sorted_files(root: &Path) -> Result<Vec<PathBuf>> {+ if !root.exists() {+ return Ok(Vec::new());+ }+ let mut files = WalkDir::new(root)+ .into_iter()+ .collect::<std::result::Result<Vec<_>, _>>()+ .with_context(|| format!("Failed to walk {}", root.display()))?+ .into_iter()+ .map(|entry| entry.path().to_path_buf())+ .filter(|path| path.is_file())+ .collect::<Vec<_>>();+ files.sort();+ Ok(files)+}++fn create_tar_gz(output: &Path, root: &Path, archive_root: &str) -> Result<()> {+ if let Some(parent) = output.parent() {+ fs::create_dir_all(parent)+ .with_context(|| format!("Failed to create {}", parent.display()))?;+ }+ let file =+ File::create(output).with_context(|| format!("Failed to create {}", output.display()))?;+ let encoder = GzEncoder::new(file, Compression::default());+ let mut builder = Builder::new(encoder);+ for path in sorted_files(root)? {+ let relative = path+ .strip_prefix(root)+ .with_context(|| format!("Failed to relativize {}", path.display()))?;+ builder+ .append_path_with_name(&path, Path::new(archive_root).join(relative))+ .with_context(|| format!("Failed to add {} to {}", path.display(), output.display()))?;+ }+ builder+ .finish()+ .with_context(|| format!("Failed to finish {}", output.display()))?;+ Ok(())+}++fn create_self_hosting_bundle(output: &Path, version: &str) -> Result<()> {+ let root = Path::new("deploy/self-hosting");+ create_self_hosting_bundle_from(root, output, version)+}++fn create_self_hosting_bundle_from(root: &Path, output: &Path, version: &str) -> Result<()> {+ ensure!(root.is_dir(), "{} does not exist", root.display());+ if let Some(parent) = output.parent() {+ fs::create_dir_all(parent)+ .with_context(|| format!("Failed to create {}", parent.display()))?;+ }+ let archive_root = format!("fluxer-self-hosting-{version}");+ let file =+ File::create(output).with_context(|| format!("Failed to create {}", output.display()))?;+ let encoder = GzEncoder::new(file, Compression::default());+ let mut builder = Builder::new(encoder);+ for path in sorted_files(root)? {+ let relative = path+ .strip_prefix(root)+ .with_context(|| format!("Failed to relativize {}", path.display()))?;+ builder+ .append_path_with_name(&path, Path::new(&archive_root).join(relative))+ .with_context(|| format!("Failed to add {} to {}", path.display(), output.display()))?;+ }+ append_generated_tar_file(+ &mut builder,+ &Path::new(&archive_root).join("release.env"),+ format!("FLUXER_IMAGE_TAG={version}\n").as_bytes(),+ )?;+ builder+ .finish()+ .with_context(|| format!("Failed to finish {}", output.display()))?;+ Ok(())+}++fn append_generated_tar_file<W: io::Write>(+ builder: &mut Builder<W>,+ path: &Path,+ contents: &[u8],+) -> Result<()> {+ let mut header = Header::new_gnu();+ header.set_size(contents.len() as u64);+ header.set_mode(0o644);+ header.set_cksum();+ builder+ .append_data(&mut header, path, contents)+ .with_context(|| format!("Failed to add generated {}", path.display()))+}++fn self_hosting_images(version: &str) -> Vec<Value> {+ SELF_HOSTED_IMAGE_COMPONENTS+ .iter()+ .map(|image| {+ json!({+ "name": image,+ "ref": format!("ghcr.io/fluxerapp/{image}:{version}"),+ })+ })+ .collect()+}++fn helm_chart_dirs(root: &Path) -> Result<Vec<PathBuf>> {+ let mut dirs = fs::read_dir(root)+ .with_context(|| format!("Failed to read {}", root.display()))?+ .map(|entry| entry.map(|entry| entry.path()))+ .collect::<std::result::Result<Vec<_>, _>>()?;+ dirs.retain(|path| path.join("Chart.yaml").is_file());+ dirs.sort();+ Ok(dirs)+}++fn read_fragments(dir: &Path) -> Result<Vec<ReleaseFragment>> {+ let mut fragments = Vec::new();+ for path in sorted_files(dir)? {+ if !file_name(&path)?.starts_with(RELEASE_FRAGMENT_FILENAME_PREFIX) {+ continue;+ }+ let value: Value = serde_json::from_str(+ &fs::read_to_string(&path)+ .with_context(|| format!("Failed to read {}", path.display()))?,+ )+ .with_context(|| format!("Failed to parse {}", path.display()))?;+ fragments.push(ReleaseFragment {+ filename: file_name(&path)?,+ kind: value+ .get("kind")+ .and_then(Value::as_str)+ .unwrap_or("unknown")+ .to_string(),+ value,+ });+ }+ fragments.sort_by(|a, b| a.filename.cmp(&b.filename));+ Ok(fragments)+}++#[derive(Debug, Serialize, Deserialize, Clone)]+struct ReleaseFragment {+ filename: String,+ kind: String,+ value: Value,+}++fn build_manifest(version: &str, source_sha: &str, fragments: Vec<ReleaseFragment>) -> Value {+ let mut images = BTreeMap::new();+ let mut other = Vec::new();+ for fragment in &fragments {+ match fragment.kind.as_str() {+ "image" | "app-proxy" => {+ if let Some(image) = fragment.value.get("image")+ && let Some(name) = image.get("name").and_then(Value::as_str)+ {+ images.insert(name.to_string(), image.clone());+ }+ }+ _ => other.push(fragment.value.clone()),+ }+ }+ json!({+ "schemaVersion": RELEASE_SCHEMA_VERSION,+ "version": version,+ "tag": release_tag(version),+ "sourceSha": source_sha,+ "generatedAt": Utc::now().to_rfc3339(),+ "repository": env::var("GITHUB_REPOSITORY").ok(),+ "images": images,+ "artifacts": other,+ "fragments": fragments,+ })+}++fn release_notes(manifest: &Value) -> String {+ let source_sha = manifest+ .get("sourceSha")+ .and_then(Value::as_str)+ .unwrap_or("unknown");+ let images = manifest+ .get("images")+ .and_then(Value::as_object)+ .map(|images| images.keys().cloned().collect::<BTreeSet<_>>())+ .unwrap_or_default();+ let artifacts = manifest+ .get("artifacts")+ .and_then(Value::as_array)+ .cloned()+ .unwrap_or_default();++ let mut notes =+ format!("Source: `{source_sha}`\n\nRelease manifest: `{RELEASE_MANIFEST_FILENAME}`\n");+ if !images.is_empty() {+ notes.push_str("\n## Images\n\n");+ for image in images {+ notes.push_str(&format!("- `{image}`\n"));+ }+ }+ if !artifacts.is_empty() {+ notes.push_str("\n## Artifacts\n\n");+ for artifact in artifacts {+ let kind = artifact+ .get("kind")+ .and_then(Value::as_str)+ .unwrap_or("artifact");+ notes.push_str(&format!("- `{kind}`\n"));+ }+ }+ notes+}++fn path_to_slash_string(path: &Path) -> String {+ path.components()+ .map(|component| component.as_os_str().to_string_lossy())+ .collect::<Vec<_>>()+ .join("/")+}++fn sanitize_asset_segment(value: &str) -> String {+ value+ .chars()+ .map(|ch| {+ if ch.is_ascii_alphanumeric() || ch == '-' || ch == '_' {+ ch+ } else {+ '-'+ }+ })+ .collect()+}++#[cfg(test)]+mod tests {+ use super::*;++ fn write_file(path: &Path, contents: &str) {+ if let Some(parent) = path.parent() {+ fs::create_dir_all(parent).unwrap();+ }+ fs::write(path, contents).unwrap();+ }++ #[test]+ fn release_tag_uses_build_version_without_namespace() {+ assert_eq!(release_tag("2026.520.1"), "2026.520.1");+ }++ #[test]+ fn validate_build_version_rejects_invalid_calver() {+ assert!(validate_build_version("v1").is_err());+ }++ #[test]+ fn image_fragment_contains_digest_ref() {+ let fragment = image_fragment(+ "2026.520.1",+ "abc",+ "ghcr.io/fluxerapp/fluxer-api",+ "ghcr.io/fluxerapp/fluxer-api:2026.520.1",+ "sha256:123",+ vec!["latest".to_string()],+ );+ assert_eq!(fragment["kind"], "image");+ assert_eq!(+ fragment["image"]["digestRef"],+ "ghcr.io/fluxerapp/fluxer-api@sha256:123"+ );+ }++ #[test]+ fn static_asset_manifest_counts_non_empty_lines_and_hashes_file() {+ let temp = tempdir().unwrap();+ let path = temp.path().join("assets-manifest.txt");+ fs::write(&path, "assets/a.js\n\nassets/b.css\n").unwrap();++ let manifest = static_asset_manifest(&path).unwrap();++ assert_eq!(manifest["assetCount"], 2);+ assert_eq!(manifest["filename"], "assets-manifest.txt");+ assert_eq!(manifest["sha256"].as_str().unwrap().len(), 64);+ }++ #[test]+ fn collect_payload_manifests_records_relative_paths() {+ let temp = tempdir().unwrap();+ write_file(+ &temp.path().join("desktop/canary/linux/x64/manifest.json"),+ "{}",+ );+ write_file(+ &temp.path().join("desktop/canary/linux/x64/file.txt"),+ "ignored",+ );++ let manifests = collect_payload_manifests(&temp.path().join("desktop")).unwrap();++ assert_eq!(manifests.len(), 1);+ assert_eq!(manifests[0]["path"], "canary/linux/x64/manifest.json");+ }++ #[test]+ fn self_hosting_bundle_includes_release_env() {+ let temp = tempdir().unwrap();+ let root = temp.path().join("self-hosting");+ fs::create_dir_all(&root).unwrap();+ fs::write(root.join("docker-compose.yml"), "name: fluxer\n").unwrap();+ let output = temp.path().join("bundle.tar.gz");++ create_self_hosting_bundle_from(&root, &output, "2026.520.1").unwrap();++ assert!(output.is_file());+ assert_eq!(sha256_file(&output).unwrap().len(), 64);+ }++ #[test]+ fn build_manifest_promotes_image_fragments() {+ let fragments = vec![+ ReleaseFragment {+ filename: "fluxer-release-fragment-image-fluxer-api.json".to_string(),+ kind: "image".to_string(),+ value: image_fragment(+ "2026.520.1",+ "abc",+ "fluxer-api",+ "ghcr.io/fluxerapp/fluxer-api:2026.520.1",+ "sha256:123",+ Vec::new(),+ ),+ },+ ReleaseFragment {+ filename: "fluxer-release-fragment-helm.json".to_string(),+ kind: "helm".to_string(),+ value: json!({"kind": "helm"}),+ },+ ];++ let manifest = build_manifest("2026.520.1", "abc", fragments);++ assert_eq!(manifest["images"]["fluxer-api"]["digest"], "sha256:123");+ assert_eq!(manifest["artifacts"][0]["kind"], "helm");+ }++ #[test]+ fn release_notes_include_images_and_artifact_kinds() {+ let manifest = json!({+ "version": "2026.520.1",+ "sourceSha": "abc",+ "images": {+ "fluxer-api": {"digest": "sha256:123"},+ "fluxer-users": {"digest": "sha256:456"},+ },+ "artifacts": [+ {"kind": "helm"},+ {"kind": "self-hosting"},+ ],+ });++ let notes = release_notes(&manifest);++ assert!(notes.contains("Source: `abc`"));+ assert!(notes.contains("Release manifest: `fluxer-release-manifest.json`"));+ assert!(notes.contains("- `fluxer-api`"));+ assert!(notes.contains("- `fluxer-users`"));+ assert!(notes.contains("- `helm`"));+ assert!(notes.contains("- `self-hosting`"));+ }++ #[test]+ fn self_hosting_images_match_compose_release_surface() {+ let images = self_hosting_images("2026.520.1")+ .into_iter()+ .map(|image| image["name"].as_str().unwrap().to_string())+ .collect::<Vec<_>>();++ assert_eq!(+ images,+ vec![+ "fluxer-admin",+ "fluxer-api",+ "fluxer-app-proxy-self-hosted",+ "fluxer-gateway",+ "fluxer-gifs",+ "fluxer-media-proxy",+ "fluxer-messages",+ "fluxer-snowflakes",+ "fluxer-static",+ "fluxer-unfurl",+ "fluxer-users",+ ]+ );+ }++ #[test]+ fn helm_chart_dirs_are_sorted_and_require_chart_yaml() {+ let temp = tempdir().unwrap();+ fs::create_dir_all(temp.path().join("b")).unwrap();+ fs::create_dir_all(temp.path().join("a")).unwrap();+ fs::create_dir_all(temp.path().join("ignored")).unwrap();+ fs::write(temp.path().join("b/Chart.yaml"), "name: b\n").unwrap();+ fs::write(temp.path().join("a/Chart.yaml"), "name: a\n").unwrap();++ let dirs = helm_chart_dirs(temp.path())+ .unwrap()+ .into_iter()+ .map(|path| file_name(&path).unwrap())+ .collect::<Vec<_>>();++ assert_eq!(dirs, vec!["a", "b"]);+ }++ #[test]+ fn digest_ref_replaces_tag_with_digest() {+ assert_eq!(+ digest_ref("ghcr.io/fluxerapp/fluxer-api:2026.520.1", "sha256:abc"),+ "ghcr.io/fluxerapp/fluxer-api@sha256:abc"+ );+ }++ #[test]+ fn parse_csv_trims_empty_entries() {+ assert_eq!(parse_csv("v1, latest,,"), vec!["v1", "latest"]);+ }+}