mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Simplify reprepro using new composite action (#1320)
This commit is contained in:
parent
06df6e97fe
commit
ea22bcf1eb
53
.github/workflows/build_and_deploy.yaml
vendored
53
.github/workflows/build_and_deploy.yaml
vendored
@ -108,8 +108,6 @@ jobs:
|
|||||||
sqlcipher: static
|
sqlcipher: static
|
||||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||||
|
|
||||||
# This deploy job only handles Windows, macOS & linux_static as those are stateless and static.
|
|
||||||
# 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
|
- prepare
|
||||||
@ -130,9 +128,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
|
||||||
name: packages.element.io
|
|
||||||
path: packages.element.io
|
|
||||||
|
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
run: |
|
run: |
|
||||||
@ -150,23 +145,31 @@ jobs:
|
|||||||
repository: vector-im/packages.element.io
|
repository: vector-im/packages.element.io
|
||||||
event-type: packages-index
|
event-type: packages-index
|
||||||
|
|
||||||
reprepro:
|
- name: Find debs
|
||||||
needs:
|
id: deb
|
||||||
- linux
|
if: inputs.linux
|
||||||
# We queue this after the other deploy stage as we want to abort if that fails
|
run: |
|
||||||
- deploy
|
for arch in amd64 arm64
|
||||||
name: Run reprepro ${{ matrix.arch }}
|
do
|
||||||
strategy:
|
echo "$arch=$(ls linux-$arch-sqlcipher-system/*.deb | tail -n1)" >> $GITHUB_OUTPUT
|
||||||
matrix:
|
done
|
||||||
arch: [amd64, arm64]
|
|
||||||
if: |
|
- name: Publish amd64 deb to packages.element.io
|
||||||
always() && !failure() && !cancelled() && ((
|
uses: vector-im/packages.element.io@master
|
||||||
github.event_name != 'workflow_dispatch' &&
|
if: inputs.linux
|
||||||
github.event.release.prerelease != true
|
with:
|
||||||
) || (
|
file: ${{ steps.deb.outputs.amd64 }}
|
||||||
inputs.deploy && inputs.linux
|
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
))
|
bucket-api: ${{ vars.CF_R2_S3_API }}
|
||||||
uses: ./.github/workflows/reprepro.yaml
|
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||||
secrets: inherit
|
bucket-access-key: ${{ secrets.CF_R2_TOKEN }}
|
||||||
with:
|
|
||||||
artifact-name: linux-${{ matrix.arch }}-sqlcipher-system
|
- name: Publish arm64 deb to packages.element.io
|
||||||
|
uses: vector-im/packages.element.io@master
|
||||||
|
if: inputs.linux
|
||||||
|
with:
|
||||||
|
file: ${{ steps.deb.outputs.arm64 }}
|
||||||
|
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
bucket-api: ${{ vars.CF_R2_S3_API }}
|
||||||
|
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||||
|
bucket-access-key: ${{ secrets.CF_R2_TOKEN }}
|
||||||
|
49
.github/workflows/reprepro.yaml
vendored
49
.github/workflows/reprepro.yaml
vendored
@ -1,49 +0,0 @@
|
|||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
artifact-name:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
description: "The name of the artifact containing the deb to include"
|
|
||||||
secrets:
|
|
||||||
ELEMENT_BOT_TOKEN:
|
|
||||||
required: true
|
|
||||||
CF_R2_ACCESS_KEY_ID:
|
|
||||||
required: true
|
|
||||||
CF_R2_TOKEN:
|
|
||||||
required: true
|
|
||||||
# Protect reprepro database using concurrency
|
|
||||||
concurrency: reprepro
|
|
||||||
jobs:
|
|
||||||
reprepro:
|
|
||||||
name: Deploy debian package
|
|
||||||
environment: packages.element.io
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
R2_INCOMING_BUCKET: ${{ vars.R2_INCOMING_BUCKET }}
|
|
||||||
R2_URL: ${{ vars.CF_R2_S3_API }}
|
|
||||||
steps:
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.artifact-name }}
|
|
||||||
path: dist
|
|
||||||
|
|
||||||
- name: Upload incoming deb
|
|
||||||
id: upload
|
|
||||||
run: |
|
|
||||||
deb="$(ls *.deb | tail -n1)"
|
|
||||||
echo "incoming=$deb" >> $GITHUB_OUTPUT
|
|
||||||
aws s3 cp "$deb" "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto
|
|
||||||
working-directory: dist
|
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
|
||||||
|
|
||||||
- name: Notify packages.element.io of incoming deb
|
|
||||||
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
||||||
repository: vector-im/packages.element.io
|
|
||||||
event-type: reprepro-incoming
|
|
||||||
client-payload: '{"incoming": "${{ steps.upload.outputs.incoming }}"}'
|
|
Loading…
Reference in New Issue
Block a user