From dfae907c6eaa6b520ba037b84d3638818b78f9b2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 30 Mar 2023 09:13:15 +0100 Subject: [PATCH 1/4] Ship linux tarball with static sqlcipher --- .github/workflows/build_and_deploy.yaml | 19 ++++++++++++-- .github/workflows/build_linux.yaml | 34 ++++++++++++++++++++++++- .github/workflows/build_macos.yaml | 2 +- .github/workflows/build_windows.yaml | 2 +- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index 0adc19cfa1..49e4ee025f 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -90,22 +90,37 @@ jobs: base-url: https://packages.element.io/${{ inputs.mode == 'release' && 'desktop' || 'nightly' }} version: ${{ needs.prepare.outputs.macos-version }} + # We do not put this call into deploy-mode as we do not want it to add to the packages.element.io artifact + # We ship this build via reprepro only linux: if: github.event_name != 'workflow_dispatch' || inputs.linux needs: prepare - name: Linux + name: Linux (sqlcipher system) uses: ./.github/workflows/build_linux.yaml with: config: element.io/${{ inputs.mode || 'nightly' }} sqlcipher: system version: ${{ needs.prepare.outputs.linux-version }} - # This deploy job only handles Windows & macOS as those are stateless and static. + # We ship the static build via static tarball only + linux_static: + if: github.event_name != 'workflow_dispatch' || inputs.linux + needs: prepare + name: Linux (sqlcipher static) + uses: ./.github/workflows/build_linux.yaml + with: + deploy-mode: true + config: element.io/${{ inputs.mode || 'nightly' }} + sqlcipher: static + version: ${{ needs.prepare.outputs.linux-version }} + + # This deploy job only handles Windows, macOS & linux_static as those are stateless and static. # Linux will be deployed via reprepro after it, but we list it as a dependency to abort if it fails. deploy: needs: - macos - linux + - linux_static - windows_32bit - windows_64bit runs-on: ubuntu-latest diff --git a/.github/workflows/build_linux.yaml b/.github/workflows/build_linux.yaml index b0c245bcac..c9e64d36e8 100644 --- a/.github/workflows/build_linux.yaml +++ b/.github/workflows/build_linux.yaml @@ -16,6 +16,10 @@ on: type: string required: true description: "How to link sqlcipher, one of 'system' | 'static'" + deploy-mode: + type: boolean + required: false + description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones" jobs: build: runs-on: ubuntu-latest @@ -87,9 +91,37 @@ jobs: --deb-custom-control=debcontrol yarn build --publish never -l --config electron-builder.json + - name: Stash deb package + if: inputs.deploy-mode + uses: actions/upload-artifact@v3 + with: + name: linux-sqlcipher-${{ inputs.sqlcipher }}-deb + path: dist/*.deb + retention-days: 1 + + - name: Prepare artifacts for deployment + if: inputs.deploy-mode + run: | + mv dist _dist + mkdir -p "dist/install/linux/glibc-x86-64/" + mv _dist/*.tar.gz "dist/install/linux/glibc-x86-64" + + # We don't wish to store the tarball for every nightly ever, so we only keep the latest + - name: "[Nightly] Strip version from tarball" + if: inputs.deploy-mode && inputs.version != '' + run: | + mv dist/install/linux/glibc-x86-64/*.tar.gz "dist/install/linux/glibc-x86-64/element-desktop-nightly.tar.gz" + + - name: "[Release] Prepare release latest symlink" + if: inputs.deploy-mode && inputs.version == '' + shell: bash + run: | + ln -s "$(find . -type f -iname "*.tar.gz" | xargs -0 -n1 -- basename)" "element-desktop.tar.gz" + working-directory: "dist/install/linux/glibc-x86-64" + - name: Upload Artifacts uses: actions/upload-artifact@v3 with: - name: linux-sqlcipher-${{ inputs.sqlcipher }} + name: ${{ inputs.deploy-mode && 'packages.element.io' || format('linux-sqlcipher-{0}', inputs.sqlcipher) }} path: dist retention-days: 1 diff --git a/.github/workflows/build_macos.yaml b/.github/workflows/build_macos.yaml index e032f12713..26d3f87570 100644 --- a/.github/workflows/build_macos.yaml +++ b/.github/workflows/build_macos.yaml @@ -24,7 +24,7 @@ on: required: false description: "Whether to sign & notarise the build, requires 'packages.element.io' environment" deploy-mode: - type: string + type: boolean required: false description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones" base-url: diff --git a/.github/workflows/build_windows.yaml b/.github/workflows/build_windows.yaml index 6acee52b5e..ff4f07ac8d 100644 --- a/.github/workflows/build_windows.yaml +++ b/.github/workflows/build_windows.yaml @@ -24,7 +24,7 @@ on: required: false description: "Whether to sign & notarise the build, requires 'packages.element.io' environment" deploy-mode: - type: string + type: boolean required: false description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones" jobs: From e1ed2aa9cedfc6faf049876da4f7c5846b5bceaf Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 30 Mar 2023 10:25:48 +0100 Subject: [PATCH 2/4] Test --- .github/workflows/build_and_deploy.yaml | 4 +++- .github/workflows/build_prepare.yaml | 2 +- .github/workflows/reprepro.yaml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index 49e4ee025f..fe8ffdf73a 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -1,5 +1,7 @@ name: Build and Deploy on: + push: + branches: ["t3chguy/fix/18486"] # Nightly build schedule: - cron: "0 9 * * *" @@ -41,7 +43,7 @@ on: default: true concurrency: ${{ github.workflow }} env: - R2_BUCKET: "packages-element-io" + R2_BUCKET: "packages-element-io-test" jobs: prepare: uses: ./.github/workflows/build_prepare.yaml diff --git a/.github/workflows/build_prepare.yaml b/.github/workflows/build_prepare.yaml index 65fec260e7..bdc9f10ff7 100644 --- a/.github/workflows/build_prepare.yaml +++ b/.github/workflows/build_prepare.yaml @@ -84,7 +84,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }} - R2_BUCKET: "packages-element-io" + R2_BUCKET: "packages-element-io-test" R2_URL: ${{ secrets.CF_R2_S3_API }} - name: Check version diff --git a/.github/workflows/reprepro.yaml b/.github/workflows/reprepro.yaml index 12765b438f..1c1946de1f 100644 --- a/.github/workflows/reprepro.yaml +++ b/.github/workflows/reprepro.yaml @@ -24,8 +24,8 @@ jobs: environment: packages.element.io runs-on: ubuntu-latest env: - R2_BUCKET: "packages-element-io" - R2_DB_BUCKET: packages-element-io-db + R2_BUCKET: "packages-element-io-test" + R2_DB_BUCKET: packages-element-io-db-test R2_URL: ${{ secrets.CF_R2_S3_API }} steps: - uses: actions/checkout@v3 From ac3dd0d853bc864ebf7395ad7701481bccbc1c97 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 30 Mar 2023 18:00:34 +0100 Subject: [PATCH 3/4] Revert test bucket changes --- .github/workflows/build_and_deploy.yaml | 2 +- .github/workflows/build_prepare.yaml | 2 +- .github/workflows/reprepro.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index fe8ffdf73a..640e542f60 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -43,7 +43,7 @@ on: default: true concurrency: ${{ github.workflow }} env: - R2_BUCKET: "packages-element-io-test" + R2_BUCKET: "packages-element-io" jobs: prepare: uses: ./.github/workflows/build_prepare.yaml diff --git a/.github/workflows/build_prepare.yaml b/.github/workflows/build_prepare.yaml index bdc9f10ff7..65fec260e7 100644 --- a/.github/workflows/build_prepare.yaml +++ b/.github/workflows/build_prepare.yaml @@ -84,7 +84,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }} - R2_BUCKET: "packages-element-io-test" + R2_BUCKET: "packages-element-io" R2_URL: ${{ secrets.CF_R2_S3_API }} - name: Check version diff --git a/.github/workflows/reprepro.yaml b/.github/workflows/reprepro.yaml index 1c1946de1f..12765b438f 100644 --- a/.github/workflows/reprepro.yaml +++ b/.github/workflows/reprepro.yaml @@ -24,8 +24,8 @@ jobs: environment: packages.element.io runs-on: ubuntu-latest env: - R2_BUCKET: "packages-element-io-test" - R2_DB_BUCKET: packages-element-io-db-test + R2_BUCKET: "packages-element-io" + R2_DB_BUCKET: packages-element-io-db R2_URL: ${{ secrets.CF_R2_S3_API }} steps: - uses: actions/checkout@v3 From 9582edbb1909d6502ea3609606bbb0b77be8514f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 31 Mar 2023 10:11:25 +0100 Subject: [PATCH 4/4] Update build_and_deploy.yaml --- .github/workflows/build_and_deploy.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index 640e542f60..49e4ee025f 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -1,7 +1,5 @@ name: Build and Deploy on: - push: - branches: ["t3chguy/fix/18486"] # Nightly build schedule: - cron: "0 9 * * *"