mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Run more of the deploy code for pre-releases (#1440)
This commit is contained in:
parent
bc4c4159dc
commit
ae187445af
35
.github/workflows/build_and_deploy.yaml
vendored
35
.github/workflows/build_and_deploy.yaml
vendored
@ -48,6 +48,7 @@ jobs:
|
|||||||
config: element.io/${{ inputs.mode || (github.event_name == 'release' && 'release') || 'nightly' }}
|
config: element.io/${{ inputs.mode || (github.event_name == 'release' && 'release') || 'nightly' }}
|
||||||
version: ${{ (inputs.mode != 'release' && github.event_name != 'release') && 'develop' || '' }}
|
version: ${{ (inputs.mode != 'release' && github.event_name != 'release') && 'develop' || '' }}
|
||||||
nightly: ${{ inputs.mode != 'release' && github.event_name != 'release' }}
|
nightly: ${{ inputs.mode != 'release' && github.event_name != 'release' }}
|
||||||
|
deploy: ${{ inputs.deploy || (github.event_name != 'workflow_dispatch' && github.event.release.prerelease != true) }}
|
||||||
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 }}
|
||||||
@ -102,15 +103,9 @@ jobs:
|
|||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Deploy
|
name: ${{ needs.prepare.outputs.deploy && 'Deploy' || 'Deploy (dry-run)' }}
|
||||||
if: |
|
if: always() && !failure() && !cancelled()
|
||||||
always() && !failure() && !cancelled() && ((
|
environment: ${{ needs.prepare.outputs.deploy && 'packages.element.io' || '' }}
|
||||||
github.event_name != 'workflow_dispatch' &&
|
|
||||||
github.event.release.prerelease != true
|
|
||||||
) || (
|
|
||||||
inputs.deploy && (inputs.macos || inputs.windows || inputs.linux)
|
|
||||||
))
|
|
||||||
environment: packages.element.io
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -185,7 +180,15 @@ jobs:
|
|||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Stash packages.element.io
|
||||||
|
if: ${{ !needs.prepare.outputs.deploy }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: packages.element.io
|
||||||
|
path: packages.element.io
|
||||||
|
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
|
if: needs.prepare.outputs.deploy
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp --recursive packages.element.io/ s3://$R2_BUCKET/$DEPLOYMENT_DIR --endpoint-url $R2_URL --region auto
|
aws s3 cp --recursive packages.element.io/ s3://$R2_BUCKET/$DEPLOYMENT_DIR --endpoint-url $R2_URL --region auto
|
||||||
env:
|
env:
|
||||||
@ -195,6 +198,7 @@ jobs:
|
|||||||
DEPLOYMENT_DIR: ${{ needs.prepare.outputs.packages-dir }}
|
DEPLOYMENT_DIR: ${{ needs.prepare.outputs.packages-dir }}
|
||||||
|
|
||||||
- name: Notify packages.element.io of new files
|
- name: Notify packages.element.io of new files
|
||||||
|
if: needs.prepare.outputs.deploy
|
||||||
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
|
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
@ -210,9 +214,18 @@ jobs:
|
|||||||
echo "$arch=$(ls linux-$arch-sqlcipher-system/*.deb | tail -n1)" >> $GITHUB_OUTPUT
|
echo "$arch=$(ls linux-$arch-sqlcipher-system/*.deb | tail -n1)" >> $GITHUB_OUTPUT
|
||||||
done
|
done
|
||||||
|
|
||||||
|
- name: Stash debs
|
||||||
|
if: ${{ !needs.prepare.outputs.deploy && needs.linux.result == 'success' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: debs
|
||||||
|
path: |
|
||||||
|
${{ steps.deb.outputs.amd64 }}
|
||||||
|
${{ steps.deb.outputs.arm64 }}
|
||||||
|
|
||||||
- name: Publish amd64 deb to packages.element.io
|
- name: Publish amd64 deb to packages.element.io
|
||||||
uses: element-hq/packages.element.io@master
|
uses: element-hq/packages.element.io@master
|
||||||
if: needs.linux.result == 'success'
|
if: needs.prepare.outputs.deploy && needs.linux.result == 'success'
|
||||||
with:
|
with:
|
||||||
file: ${{ steps.deb.outputs.amd64 }}
|
file: ${{ steps.deb.outputs.amd64 }}
|
||||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
@ -222,7 +235,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish arm64 deb to packages.element.io
|
- name: Publish arm64 deb to packages.element.io
|
||||||
uses: element-hq/packages.element.io@master
|
uses: element-hq/packages.element.io@master
|
||||||
if: needs.linux.result == 'success'
|
if: needs.prepare.outputs.deploy && needs.linux.result == 'success'
|
||||||
with:
|
with:
|
||||||
file: ${{ steps.deb.outputs.arm64 }}
|
file: ${{ steps.deb.outputs.arm64 }}
|
||||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
10
.github/workflows/build_prepare.yaml
vendored
10
.github/workflows/build_prepare.yaml
vendored
@ -15,6 +15,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
description: "Whether the build is a Nightly and to calculate the version strings new builds should use"
|
description: "Whether the build is a Nightly and to calculate the version strings new builds should use"
|
||||||
|
deploy:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: "Whether the build should be deployed to production"
|
||||||
secrets:
|
secrets:
|
||||||
# Required if `nightly` is set
|
# Required if `nightly` is set
|
||||||
CF_R2_ACCESS_KEY_ID:
|
CF_R2_ACCESS_KEY_ID:
|
||||||
@ -29,10 +34,13 @@ on:
|
|||||||
packages-dir:
|
packages-dir:
|
||||||
description: "The directory non-deb packages for this run should live in within packages.element.io"
|
description: "The directory non-deb packages for this run should live in within packages.element.io"
|
||||||
value: ${{ inputs.nightly && 'nightly' || 'desktop' }}
|
value: ${{ inputs.nightly && 'nightly' || 'desktop' }}
|
||||||
# This is just a simple pass-through of the input to simplify reuse of complex inline conditions
|
# These are just simple pass-throughs of the input to simplify reuse of complex inline conditions
|
||||||
config:
|
config:
|
||||||
description: "The relative path to the config file for this run"
|
description: "The relative path to the config file for this run"
|
||||||
value: ${{ inputs.config }}
|
value: ${{ inputs.config }}
|
||||||
|
deploy:
|
||||||
|
description: "The relative path to the config file for this run"
|
||||||
|
value: ${{ inputs.deploy }}
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Prepare
|
name: Prepare
|
||||||
|
Loading…
Reference in New Issue
Block a user