mirror of
https://github.com/element-hq/element-desktop
synced 2025-03-13 15:58:41 +01:00
Simplify linux builds (#2122)
* Simplify linux builds Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Try RUNNER_TEMP Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Try APP_BUILDER_TMP_DIR Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Try runner.temp instead Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Perms? Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add workaround for https://github.com/electron-userland/electron-builder/issues/6116 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
3e98c2c525
commit
5c6e0f14d0
68
.github/workflows/build_linux.yaml
vendored
68
.github/workflows/build_linux.yaml
vendored
@ -25,16 +25,12 @@ env:
|
|||||||
MAX_GLIBC: 2.31 # bullseye-era glibc, used by glibc-check.sh
|
MAX_GLIBC: 2.31 # bullseye-era glibc, used by glibc-check.sh
|
||||||
permissions: {} # No permissions required
|
permissions: {} # No permissions required
|
||||||
jobs:
|
jobs:
|
||||||
# We build the hak files on native infrastructure as matrix-seshat fails to cross-compile properly
|
build:
|
||||||
# https://github.com/matrix-org/seshat/issues/135
|
# We build on native infrastructure as matrix-seshat fails to cross-compile properly
|
||||||
hak:
|
# https://github.com/matrix-org/seshat/issues/135
|
||||||
runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }}
|
runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }}
|
||||||
env:
|
env:
|
||||||
HAK_DOCKER_IMAGE: ghcr.io/element-hq/element-desktop-dockerbuild
|
HAK_DOCKER_IMAGE: ghcr.io/element-hq/element-desktop-dockerbuild
|
||||||
outputs:
|
|
||||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
|
||||||
arch: ${{ steps.config.outputs.arch }}
|
|
||||||
build-args: ${{ steps.config.outputs.build-args }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Resolve docker image tag for push
|
- name: Resolve docker image tag for push
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
@ -70,18 +66,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: webapp
|
name: webapp
|
||||||
|
|
||||||
- name: Calculate cache key
|
|
||||||
id: cache-key
|
|
||||||
run: |
|
|
||||||
echo "key=$CACHE_KEY" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
CACHE_KEY: ${{ runner.os }}-${{ github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion', 'dockerbuild/*') }}
|
|
||||||
|
|
||||||
- name: Cache .hak
|
- name: Cache .hak
|
||||||
id: cache
|
id: cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
key: ${{ steps.cache-key.outputs.key }}
|
key: ${{ runner.os }}-${{ github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion', 'dockerbuild/*') }}
|
||||||
path: |
|
path: |
|
||||||
./.hak
|
./.hak
|
||||||
|
|
||||||
@ -93,7 +82,6 @@ jobs:
|
|||||||
# Workaround for https://github.com/actions/setup-node/issues/317
|
# Workaround for https://github.com/actions/setup-node/issues/317
|
||||||
FORCE_COLOR: 0
|
FORCE_COLOR: 0
|
||||||
|
|
||||||
# Does not need branch matching as only analyses this layer
|
|
||||||
- name: Install Deps
|
- name: Install Deps
|
||||||
run: "yarn install --frozen-lockfile"
|
run: "yarn install --frozen-lockfile"
|
||||||
|
|
||||||
@ -124,7 +112,10 @@ jobs:
|
|||||||
$HAK_DOCKER_IMAGE \
|
$HAK_DOCKER_IMAGE \
|
||||||
yarn build:native
|
yarn build:native
|
||||||
|
|
||||||
- name: Check native libraries
|
- name: Fix permissions on .hak
|
||||||
|
run: sudo chown -R $USER:$USER .hak
|
||||||
|
|
||||||
|
- name: Check native libraries in hak dependencies
|
||||||
run: |
|
run: |
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
|
|
||||||
@ -132,37 +123,6 @@ jobs:
|
|||||||
./scripts/glibc-check.sh $filename
|
./scripts/glibc-check.sh $filename
|
||||||
done
|
done
|
||||||
|
|
||||||
build:
|
|
||||||
needs: hak
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: webapp
|
|
||||||
|
|
||||||
- name: Load .hak
|
|
||||||
id: cache
|
|
||||||
uses: actions/cache/restore@v4
|
|
||||||
with:
|
|
||||||
key: ${{ needs.hak.outputs.cache-key }}
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
path: |
|
|
||||||
./.hak
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: package.json
|
|
||||||
cache: "yarn"
|
|
||||||
env:
|
|
||||||
# Workaround for https://github.com/actions/setup-node/issues/317
|
|
||||||
FORCE_COLOR: 0
|
|
||||||
|
|
||||||
# Does not need branch matching as only analyses this layer
|
|
||||||
- name: Install Deps
|
|
||||||
run: "yarn install --frozen-lockfile"
|
|
||||||
|
|
||||||
- name: "[Nightly] Resolve version"
|
- name: "[Nightly] Resolve version"
|
||||||
if: inputs.version != ''
|
if: inputs.version != ''
|
||||||
run: |
|
run: |
|
||||||
@ -174,8 +134,16 @@ jobs:
|
|||||||
echo "ED_DEBIAN_CHANGELOG=changelog.Debian" >> $GITHUB_ENV
|
echo "ED_DEBIAN_CHANGELOG=changelog.Debian" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Workaround for https://github.com/electron-userland/electron-builder/issues/6116
|
||||||
|
- name: Install fpm
|
||||||
|
if: inputs.arch == 'arm64'
|
||||||
|
run: |
|
||||||
|
sudo apt-get install ruby-dev build-essential
|
||||||
|
sudo gem install fpm
|
||||||
|
echo "USE_SYSTEM_FPM=true" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build App
|
- name: Build App
|
||||||
run: yarn build --publish never -l ${{ needs.hak.outputs.build-args }}
|
run: yarn build --publish never -l ${{ steps.config.outputs.build-args }}
|
||||||
|
|
||||||
- name: Check native libraries
|
- name: Check native libraries
|
||||||
run: |
|
run: |
|
||||||
@ -203,7 +171,7 @@ jobs:
|
|||||||
|
|
||||||
./scripts/glibc-check.sh dist/linux-*unpacked/element-desktop*
|
./scripts/glibc-check.sh dist/linux-*unpacked/element-desktop*
|
||||||
env:
|
env:
|
||||||
ARCH: ${{ needs.hak.outputs.arch }}
|
ARCH: ${{ steps.config.outputs.arch }}
|
||||||
|
|
||||||
# We exclude *-unpacked as it loses permissions and the tarball contains it with correct permissions
|
# We exclude *-unpacked as it loses permissions and the tarball contains it with correct permissions
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user