mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Improve workflow reuse (#452)
This commit is contained in:
parent
1e6a3ceebd
commit
d45b3aac65
13
.github/workflows/build.yaml
vendored
13
.github/workflows/build.yaml
vendored
@ -9,16 +9,29 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
fetch:
|
fetch:
|
||||||
uses: ./.github/workflows/build_prepare.yaml
|
uses: ./.github/workflows/build_prepare.yaml
|
||||||
|
with:
|
||||||
|
config: ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }}
|
||||||
|
version: ${{ github.event.pull_request.base.ref == 'develop' && 'develop' || '' }}
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
needs: fetch
|
needs: fetch
|
||||||
name: Windows
|
name: Windows
|
||||||
uses: ./.github/workflows/build_windows.yaml
|
uses: ./.github/workflows/build_windows.yaml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [ x64, x86 ]
|
||||||
|
with:
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
needs: fetch
|
needs: fetch
|
||||||
name: Linux
|
name: Linux
|
||||||
uses: ./.github/workflows/build_linux.yaml
|
uses: ./.github/workflows/build_linux.yaml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
sqlcipher: [ system, static ]
|
||||||
|
with:
|
||||||
|
sqlcipher: ${{ matrix.sqlcipher }}
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
needs: fetch
|
needs: fetch
|
||||||
|
18
.github/workflows/build_linux.yaml
vendored
18
.github/workflows/build_linux.yaml
vendored
@ -1,14 +1,12 @@
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
sqlcipher:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: "How to link sqlcipher, one of 'system' | 'static'"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- sqlcipher: system
|
|
||||||
- sqlcipher: static
|
|
||||||
static: 1
|
|
||||||
name: '${{ matrix.sqlcipher }} sqlcipher'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -30,7 +28,7 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: Install libsqlcipher-dev
|
- name: Install libsqlcipher-dev
|
||||||
if: matrix.sqlcipher == 'system'
|
if: inputs.sqlcipher == 'system'
|
||||||
run: sudo apt-get install -y libsqlcipher-dev
|
run: sudo apt-get install -y libsqlcipher-dev
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
@ -44,7 +42,7 @@ jobs:
|
|||||||
- name: Build Natives
|
- name: Build Natives
|
||||||
run: "yarn build:native"
|
run: "yarn build:native"
|
||||||
env:
|
env:
|
||||||
SQLCIPHER_STATIC: ${{ matrix.static }}
|
SQLCIPHER_STATIC: ${{ inputs.sqlcipher == 'static' && '1' || '' }}
|
||||||
|
|
||||||
- name: Build App
|
- name: Build App
|
||||||
run: "yarn build --publish never"
|
run: "yarn build --publish never"
|
||||||
@ -55,6 +53,6 @@ jobs:
|
|||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux-sqlcipher-${{ matrix.sqlcipher }}
|
name: linux-sqlcipher-${{ inputs.sqlcipher }}
|
||||||
path: dist
|
path: dist
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
1
.github/workflows/build_macos.yaml
vendored
1
.github/workflows/build_macos.yaml
vendored
@ -2,7 +2,6 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Universal
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
16
.github/workflows/build_prepare.yaml
vendored
16
.github/workflows/build_prepare.yaml
vendored
@ -1,5 +1,14 @@
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: "The config directory to use"
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
description: "The version tag to fetch, or 'develop', will pick automatically if not passed"
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Prepare
|
name: Prepare
|
||||||
@ -14,13 +23,8 @@ jobs:
|
|||||||
- name: Install Deps
|
- name: Install Deps
|
||||||
run: "yarn install --pure-lockfile"
|
run: "yarn install --pure-lockfile"
|
||||||
|
|
||||||
- name: Fetch Element Web (develop)
|
|
||||||
if: github.event.pull_request.base.ref == 'develop'
|
|
||||||
run: yarn run fetch --noverify develop -d element.io/nightly
|
|
||||||
|
|
||||||
- name: Fetch Element Web
|
- name: Fetch Element Web
|
||||||
if: github.event.pull_request.base.ref != 'develop'
|
run: yarn run fetch --noverify -d ${{ inputs.config }} ${{ inputs.version }}
|
||||||
run: yarn run fetch --noverify --cfgdir element.io/release
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
40
.github/workflows/build_windows.yaml
vendored
40
.github/workflows/build_windows.yaml
vendored
@ -1,18 +1,30 @@
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
arch:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: "The architecture to build for, one of 'x64' | 'x86'"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- target: x86_64-pc-windows-msvc
|
|
||||||
arch: x64
|
|
||||||
- target: i686-pc-windows-msvc
|
|
||||||
arch: x86
|
|
||||||
build-args: --ia32
|
|
||||||
name: ${{ matrix.arch }}
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: kanga333/variable-mapper@master
|
||||||
|
id: config
|
||||||
|
with:
|
||||||
|
key: "${{ inputs.arch }}"
|
||||||
|
export_to: output
|
||||||
|
map: |
|
||||||
|
{
|
||||||
|
"x64": {
|
||||||
|
"target": "x86_64-pc-windows-msvc"
|
||||||
|
},
|
||||||
|
"x86": {
|
||||||
|
"target": "i686-pc-windows-msvc",
|
||||||
|
"build-args": "--ia32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
@ -29,7 +41,7 @@ jobs:
|
|||||||
- name: Set up build tools
|
- name: Set up build tools
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
with:
|
with:
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ inputs.arch }}
|
||||||
|
|
||||||
# ActiveTCL package on choco is from 2015,
|
# ActiveTCL package on choco is from 2015,
|
||||||
# this one is newer but includes more than we need
|
# this one is newer but includes more than we need
|
||||||
@ -49,7 +61,7 @@ jobs:
|
|||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
target: ${{ matrix.target }}
|
target: ${{ steps.config.outputs.target }}
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@ -62,14 +74,14 @@ jobs:
|
|||||||
- name: Build Natives
|
- name: Build Natives
|
||||||
run: |
|
run: |
|
||||||
refreshenv
|
refreshenv
|
||||||
yarn build:native --target ${{ matrix.target }}
|
yarn build:native --target ${{ steps.config.outputs.target }}
|
||||||
|
|
||||||
- name: Build App
|
- name: Build App
|
||||||
run: "yarn build --publish never -w ${{ matrix.build-args }}"
|
run: "yarn build --publish never -w ${{ steps.config.outputs.build-args }}"
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: win-${{ matrix.arch }}
|
name: win-${{ inputs.arch }}
|
||||||
path: dist
|
path: dist
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user