-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport staging] Ship element-web as a debian package (#26563)
Co-authored-by: Michael Telatynski <[email protected]>
- Loading branch information
Showing
3 changed files
with
44 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,38 +31,48 @@ jobs: | |
|
||
- name: Prepare | ||
run: | | ||
mkdir -p /tmp/element-web-debian/DEBIAN | ||
cp -R debian/ /tmp/element-web-debian/DEBIAN/ | ||
mkdir -p /tmp/element-web-debian/usr/share/element-web/ | ||
mkdir -p debian/tmp/DEBIAN | ||
find debian -maxdepth 1 -type f -exec cp "{}" debian/tmp/DEBIAN/ \; | ||
mkdir -p debian/tmp/usr/share/element-web/ | ||
tar -xf "element-$VERSION.tar.gz" -C /tmp/element-web-debian/usr/share/element-web --strip-components=1 | ||
cp config.sample.json /tmp/element-web-debian/usr/share/element-web/config.json | ||
tar -xf "element-$VERSION.tar.gz" -C debian/tmp/usr/share/element-web --strip-components=1 --no-same-owner --no-same-permissions | ||
mv debian/tmp/usr/share/element-web/config{.sample,}.json | ||
- name: Write changelog | ||
run: | | ||
VERSION=$(cat package.json | jq -r .version) | ||
TIME=$(date -d "$PUBLISHED_AT" -R) | ||
{ | ||
echo "element-web ($VERSION) default; urgency=medium" | ||
echo "$BODY" | sed 's/^##/\n */g;s/^\*/ */g' | perl -pe 's/\[.+?]\((.+?)\)/\1/g' | ||
echo "" | ||
echo " -- $ACTOR <[email protected]> $TIME" | ||
} > debian/tmp/DEBIAN/changelog | ||
env: | ||
ACTOR: ${{ github.actor }} | ||
VERSION: ${{ github.event.release.tag_name }} | ||
BODY: ${{ github.event.release.body }} | ||
PUBLISHED_AT: ${{ github.event.release.published_at }} | ||
|
||
- name: Build deb package | ||
run: | | ||
VERSION=$(cat package.json | jq -r .version) | ||
chmod -R u=rw,go=r /tmp/element-web-debian/usr/share/element-web/ | ||
dpkg-deb -Zxz --root-owner-group -VVersion=$VERSION --build /tmp/element-web-debian element-web.deb | ||
chmod -R u=rw,go=r debian/tmp/usr/share/element-web/ | ||
dpkg-gencontrol -v"$VERSION" -ldebian/tmp/DEBIAN/changelog | ||
dpkg-deb -Zxz --root-owner-group --build debian/tmp element-web.deb | ||
# For now just upload the artifact to github | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: debs | ||
path: "*.deb" | ||
name: element-web.deb | ||
path: element-web.deb | ||
retention-days: 14 | ||
|
||
#- name: Upload incoming deb | ||
# if: github.event.release.prerelease == false | ||
# run: aws s3 cp element-web.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: github.event.release.prerelease == false | ||
# uses: ./.github/workflows/reprepro.yaml | ||
# secrets: inherit | ||
# with: | ||
# incoming: element-web.deb | ||
- name: Publish to packages.element.io | ||
if: github.event.release.prerelease == false | ||
uses: vector-im/packages.element.io@master | ||
with: | ||
file: element-web.deb | ||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
bucket-api: ${{ vars.CF_R2_S3_API }} | ||
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }} | ||
bucket-access-key: ${{ secrets.CF_R2_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/files | ||
/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
Package: element-web | ||
License: Apache-2.0 | ||
Vendor: [email protected] | ||
Architecture: all | ||
Source: element-web | ||
Maintainer: [email protected] | ||
Recommends: element-io-archive-keyring | ||
Section: web | ||
Priority: optional | ||
Homepage: https://element.io/ | ||
Version: ${Version} | ||
|
||
Package: element-web | ||
Architecture: all | ||
Recommends: httpd, element-io-archive-keyring | ||
Description: | ||
A feature-rich client for Matrix.org | ||
This package contains the web-based client that can be served through a web | ||
server. |