From e395178b2b46f7c57b0c7b5e9083e58aeac126c3 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 2 Aug 2023 14:40:40 +0100 Subject: [PATCH] Package release builds of element-web in package.element.io debs (#25198) --- .github/workflows/build_debian.yaml | 56 +++++++++++++++++++++++++++++ debian/conffiles | 1 + debian/control | 12 +++++++ 3 files changed, 69 insertions(+) create mode 100644 .github/workflows/build_debian.yaml create mode 100644 debian/conffiles create mode 100755 debian/control diff --git a/.github/workflows/build_debian.yaml b/.github/workflows/build_debian.yaml new file mode 100644 index 0000000000..e75c545097 --- /dev/null +++ b/.github/workflows/build_debian.yaml @@ -0,0 +1,56 @@ +name: Build Debian package +on: + release: + types: [published] +concurrency: ${{ github.workflow }} +jobs: + build: + name: Build package + if: github.event.release.prerelease == false + environment: packages.element.io + runs-on: ubuntu-latest + env: + R2_INCOMING_BUCKET: ${{ vars.R2_INCOMING_BUCKET }} + R2_URL: ${{ vars.CF_R2_S3_API }} + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + mkdir debian/DEBIAN + mv debian/* debian/DEBIAN/ + mkdir -p debian/usr/share/element-web/ + + wget https://github.com/vector-im/element-web/releases/download/$VERSION/element-$VERSION.tar.gz + mv element-* debian/usr/share/element-web + mv debian/usr/share/element-web/config.sample.json debian/usr/share/element-web/config.json + env: + VERSION: ${{ github.ref_name }} + + - name: Build deb package + run: | + VERSION=$(cat package.json | jq -r .version) + chmod -R u=rw,go=r debian/usr/share/element-web/ + dpkg-deb -Zxz --root-owner-group -VVersion=$VERSION --build debian element-web.deb + + # For now just upload the artifact to github + - uses: actions/upload-artifact@v3 + with: + name: element-io-archive-keyring + path: element-io-archive-keyring.deb + retention-days: 14 + + #- name: Upload incoming deb + # run: aws s3 cp element-io-archive-keyring.deb "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }} + + #reprepro: + # needs: build + # name: Run reprepro + # if: inputs.deploy && github.event.release.prerelease == false + # uses: ./.github/workflows/reprepro.yaml + # secrets: inherit + # with: + # incoming: element-web.deb diff --git a/debian/conffiles b/debian/conffiles new file mode 100644 index 0000000000..4d9b0b387e --- /dev/null +++ b/debian/conffiles @@ -0,0 +1 @@ +/usr/share/element-web/config.json diff --git a/debian/control b/debian/control new file mode 100755 index 0000000000..d8e38a7503 --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Package: element-web +License: Apache-2.0 +Vendor: support@element.io +Architecture: all +Maintainer: support@element.io +Recommends: element-io-archive-keyring +Section: web +Priority: optional +Homepage: https://element.io/ +Version: ${Version} +Description: + A feature-rich client for Matrix.org