2023-08-02 09:40:40 -04:00
|
|
|
name: Build Debian package
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
concurrency: ${{ github.workflow }}
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build package
|
|
|
|
environment: packages.element.io
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
R2_INCOMING_BUCKET: ${{ vars.R2_INCOMING_BUCKET }}
|
|
|
|
R2_URL: ${{ vars.CF_R2_S3_API }}
|
2023-10-25 09:39:44 -04:00
|
|
|
VERSION: ${{ github.ref_name }}
|
2023-08-02 09:40:40 -04:00
|
|
|
steps:
|
2023-09-05 13:31:32 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-02 09:40:40 -04:00
|
|
|
|
2023-10-25 09:39:44 -04:00
|
|
|
- name: Download package
|
|
|
|
run: |
|
|
|
|
wget "https://github.com/vector-im/element-web/releases/download/$VERSION/element-$VERSION.tar.gz"
|
|
|
|
wget "https://github.com/vector-im/element-web/releases/download/$VERSION/element-$VERSION.tar.gz.asc"
|
|
|
|
|
|
|
|
- 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 09:40:40 -04:00
|
|
|
- name: Prepare
|
|
|
|
run: |
|
2023-08-04 04:46:10 -04:00
|
|
|
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/
|
2023-08-02 09:40:40 -04:00
|
|
|
|
2023-10-25 09:39:44 -04:00
|
|
|
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
|
2023-08-02 09:40:40 -04:00
|
|
|
|
|
|
|
- name: Build deb package
|
|
|
|
run: |
|
|
|
|
VERSION=$(cat package.json | jq -r .version)
|
2023-08-04 04:46:10 -04:00
|
|
|
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
|
2023-08-02 09:40:40 -04:00
|
|
|
|
|
|
|
# For now just upload the artifact to github
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-08-04 04:46:10 -04:00
|
|
|
name: debs
|
|
|
|
path: "*.deb"
|
2023-08-02 09:40:40 -04:00
|
|
|
retention-days: 14
|
|
|
|
|
|
|
|
#- name: Upload incoming deb
|
2023-10-25 09:39:44 -04:00
|
|
|
# if: github.event.release.prerelease == false
|
|
|
|
# run: aws s3 cp element-web.deb "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto
|
2023-08-02 09:40:40 -04:00
|
|
|
# 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
|
2023-10-25 09:39:44 -04:00
|
|
|
# if: github.event.release.prerelease == false
|
2023-08-02 09:40:40 -04:00
|
|
|
# uses: ./.github/workflows/reprepro.yaml
|
|
|
|
# secrets: inherit
|
|
|
|
# with:
|
|
|
|
# incoming: element-web.deb
|