2023-08-02 16:40:40 +03:00
|
|
|
name: Build Debian package
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
concurrency: ${{ github.workflow }}
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build package
|
|
|
|
environment: packages.element.io
|
2024-10-17 13:10:32 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2023-08-02 16:40:40 +03:00
|
|
|
env:
|
|
|
|
R2_INCOMING_BUCKET: ${{ vars.R2_INCOMING_BUCKET }}
|
|
|
|
R2_URL: ${{ vars.CF_R2_S3_API }}
|
2023-10-25 16:39:44 +03:00
|
|
|
VERSION: ${{ github.ref_name }}
|
2023-08-02 16:40:40 +03:00
|
|
|
steps:
|
2023-09-05 20:31:32 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-02 16:40:40 +03:00
|
|
|
|
2023-10-25 16:39:44 +03:00
|
|
|
- name: Download package
|
|
|
|
run: |
|
2023-12-12 13:31:44 +03:00
|
|
|
wget "https://github.com/element-hq/element-web/releases/download/$VERSION/element-$VERSION.tar.gz"
|
|
|
|
wget "https://github.com/element-hq/element-web/releases/download/$VERSION/element-$VERSION.tar.gz.asc"
|
2023-10-25 16:39:44 +03:00
|
|
|
|
|
|
|
- name: Check GPG signature
|
|
|
|
run: |
|
|
|
|
wget "https://packages.element.io/element-release-key.gpg"
|
|
|
|
gpg --import element-release-key.gpg
|
|
|
|
gpg --fingerprint "$FINGERPRINT"
|
|
|
|
gpg --verify "element-$VERSION.tar.gz.asc" "element-$VERSION.tar.gz"
|
|
|
|
env:
|
|
|
|
FINGERPRINT: ${{ vars.GPG_FINGERPRINT }}
|
|
|
|
|
2023-08-02 16:40:40 +03:00
|
|
|
- name: Prepare
|
|
|
|
run: |
|
2023-11-09 12:56:26 +03:00
|
|
|
mkdir -p debian/tmp/DEBIAN
|
|
|
|
find debian -maxdepth 1 -type f -exec cp "{}" debian/tmp/DEBIAN/ \;
|
2023-11-21 19:28:28 +03:00
|
|
|
mkdir -p debian/tmp/usr/share/element-web/ debian/tmp/etc/element-web/
|
2023-08-02 16:40:40 +03:00
|
|
|
|
2023-11-09 12:56:26 +03:00
|
|
|
tar -xf "element-$VERSION.tar.gz" -C debian/tmp/usr/share/element-web --strip-components=1 --no-same-owner --no-same-permissions
|
2023-11-21 19:28:28 +03:00
|
|
|
mv debian/tmp/usr/share/element-web/config.sample.json debian/tmp/etc/element-web/config.json
|
|
|
|
ln -s /etc/element-web/config.json debian/tmp/usr/share/element-web/config.json
|
2023-11-09 12:56:26 +03:00
|
|
|
|
|
|
|
- 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 <support@element.io> $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 }}
|
2023-08-02 16:40:40 +03:00
|
|
|
|
|
|
|
- name: Build deb package
|
|
|
|
run: |
|
|
|
|
VERSION=$(cat package.json | jq -r .version)
|
2023-11-09 12:56:26 +03:00
|
|
|
dpkg-gencontrol -v"$VERSION" -ldebian/tmp/DEBIAN/changelog
|
|
|
|
dpkg-deb -Zxz --root-owner-group --build debian/tmp element-web.deb
|
2023-08-02 16:40:40 +03:00
|
|
|
|
2024-01-19 11:54:43 +03:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-08-02 16:40:40 +03:00
|
|
|
with:
|
2023-11-09 12:56:26 +03:00
|
|
|
name: element-web.deb
|
|
|
|
path: element-web.deb
|
2023-08-02 16:40:40 +03:00
|
|
|
retention-days: 14
|
|
|
|
|
2023-11-09 12:56:26 +03:00
|
|
|
- name: Publish to packages.element.io
|
|
|
|
if: github.event.release.prerelease == false
|
2023-12-12 13:31:44 +03:00
|
|
|
uses: element-hq/packages.element.io@master
|
2023-11-09 12:56:26 +03:00
|
|
|
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 }}
|