mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01:00
Automatically trigger desktop packages on releases (#630)
This commit is contained in:
parent
0208c4d087
commit
1929351e91
28
.github/workflows/build_and_deploy.yaml
vendored
28
.github/workflows/build_and_deploy.yaml
vendored
@ -3,6 +3,9 @@ on:
|
|||||||
# Nightly build
|
# Nightly build
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 9 * * *"
|
- cron: "0 9 * * *"
|
||||||
|
# Release build
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
# Manual nightly & release
|
# Manual nightly & release
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@ -42,9 +45,9 @@ jobs:
|
|||||||
prepare:
|
prepare:
|
||||||
uses: ./.github/workflows/build_prepare.yaml
|
uses: ./.github/workflows/build_prepare.yaml
|
||||||
with:
|
with:
|
||||||
config: element.io/${{ inputs.mode || 'nightly' }}
|
config: element.io/${{ inputs.mode || (github.event_name == 'release' && 'release') || 'nightly' }}
|
||||||
version: ${{ inputs.mode != 'release' && 'develop' || '' }}
|
version: ${{ (inputs.mode != 'release' && github.event_name != 'release') && 'develop' || '' }}
|
||||||
nightly: ${{ inputs.mode != 'release' }}
|
nightly: ${{ inputs.mode != 'release' && github.event_name != 'release' }}
|
||||||
secrets:
|
secrets:
|
||||||
CF_R2_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
CF_R2_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||||
CF_R2_TOKEN: ${{ secrets.CF_R2_TOKEN }}
|
CF_R2_TOKEN: ${{ secrets.CF_R2_TOKEN }}
|
||||||
@ -73,7 +76,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
sign: true
|
sign: true
|
||||||
deploy-mode: true
|
deploy-mode: true
|
||||||
base-url: https://packages.element.io/${{ inputs.mode == 'release' && 'desktop' || 'nightly' }}
|
base-url: https://packages.element.io/${{ needs.prepare.outputs.packages-dir }}
|
||||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||||
|
|
||||||
# We do not put these calls into deploy-mode as we do not want it to add to the packages.element.io artifact
|
# We do not put these calls into deploy-mode as we do not want it to add to the packages.element.io artifact
|
||||||
@ -88,7 +91,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/build_linux.yaml
|
uses: ./.github/workflows/build_linux.yaml
|
||||||
with:
|
with:
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
config: element.io/${{ inputs.mode || 'nightly' }}
|
config: ${{ needs.prepare.outputs.config }}
|
||||||
sqlcipher: system
|
sqlcipher: system
|
||||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||||
|
|
||||||
@ -101,7 +104,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
arch: amd64
|
arch: amd64
|
||||||
deploy-mode: true
|
deploy-mode: true
|
||||||
config: element.io/${{ inputs.mode || 'nightly' }}
|
config: ${{ needs.prepare.outputs.config }}
|
||||||
sqlcipher: static
|
sqlcipher: static
|
||||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||||
|
|
||||||
@ -109,6 +112,7 @@ jobs:
|
|||||||
# Linux will be deployed via reprepro after it, but we list it as a dependency to abort if it fails.
|
# Linux will be deployed via reprepro after it, but we list it as a dependency to abort if it fails.
|
||||||
deploy:
|
deploy:
|
||||||
needs:
|
needs:
|
||||||
|
- prepare
|
||||||
- macos
|
- macos
|
||||||
- linux
|
- linux
|
||||||
- linux_static
|
- linux_static
|
||||||
@ -116,7 +120,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Deploy
|
name: Deploy
|
||||||
if: |
|
if: |
|
||||||
github.event_name != 'workflow_dispatch' || (
|
(
|
||||||
|
github.event_name != 'workflow_dispatch' &&
|
||||||
|
github.event.release.prerelease != true
|
||||||
|
) || (
|
||||||
always() && !failure() && !cancelled() && inputs.deploy &&
|
always() && !failure() && !cancelled() && inputs.deploy &&
|
||||||
(inputs.macos || inputs.windows || inputs.linux)
|
(inputs.macos || inputs.windows || inputs.linux)
|
||||||
)
|
)
|
||||||
@ -135,7 +142,7 @@ jobs:
|
|||||||
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
||||||
R2_URL: ${{ vars.CF_R2_S3_API }}
|
R2_URL: ${{ vars.CF_R2_S3_API }}
|
||||||
DEPLOYMENT_DIR: ${{ inputs.mode == 'release' && 'desktop' || 'nightly' }}
|
DEPLOYMENT_DIR: ${{ needs.prepare.outputs.packages-dir }}
|
||||||
|
|
||||||
- name: Notify packages.element.io of new files
|
- name: Notify packages.element.io of new files
|
||||||
uses: peter-evans/repository-dispatch@26b39ed245ab8f31526069329e112ab2fb224588 # v2
|
uses: peter-evans/repository-dispatch@26b39ed245ab8f31526069329e112ab2fb224588 # v2
|
||||||
@ -154,7 +161,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
arch: [amd64, arm64]
|
arch: [amd64, arm64]
|
||||||
if: |
|
if: |
|
||||||
github.event_name != 'workflow_dispatch' || (
|
(
|
||||||
|
github.event_name != 'workflow_dispatch' &&
|
||||||
|
github.event.release.prerelease != true
|
||||||
|
) || (
|
||||||
always() && !failure() && !cancelled() && inputs.deploy && inputs.linux
|
always() && !failure() && !cancelled() && inputs.deploy && inputs.linux
|
||||||
)
|
)
|
||||||
uses: ./.github/workflows/reprepro.yaml
|
uses: ./.github/workflows/reprepro.yaml
|
||||||
|
7
.github/workflows/build_prepare.yaml
vendored
7
.github/workflows/build_prepare.yaml
vendored
@ -26,6 +26,13 @@ on:
|
|||||||
nightly-version:
|
nightly-version:
|
||||||
description: "The version string the next Nightly should use, only output for nightly"
|
description: "The version string the next Nightly should use, only output for nightly"
|
||||||
value: ${{ jobs.prepare.outputs.nightly-version }}
|
value: ${{ jobs.prepare.outputs.nightly-version }}
|
||||||
|
packages-dir:
|
||||||
|
description: "The directory non-deb packages for this run should live in within packages.element.io"
|
||||||
|
value: ${{ inputs.nightly && 'nightly' || 'desktop' }}
|
||||||
|
# This is just a simple pass-through of the input to simplify reuse of complex inline conditions
|
||||||
|
config:
|
||||||
|
description: "The relative path to the config file for this run"
|
||||||
|
value: ${{ inputs.config }}
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Prepare
|
name: Prepare
|
||||||
|
Loading…
x
Reference in New Issue
Block a user