2023-03-02 17:54:57 +01:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
artifact-name:
|
|
|
|
type: string
|
|
|
|
required: true
|
2023-04-14 12:30:14 +02:00
|
|
|
description: "The name of the artifact containing the deb to include"
|
2023-03-02 17:54:57 +01:00
|
|
|
secrets:
|
2023-04-14 12:30:14 +02:00
|
|
|
ELEMENT_BOT_TOKEN:
|
|
|
|
required: true
|
2023-03-02 17:54:57 +01:00
|
|
|
CF_R2_ACCESS_KEY_ID:
|
2023-04-14 12:30:14 +02:00
|
|
|
required: true
|
2023-03-02 17:54:57 +01:00
|
|
|
CF_R2_TOKEN:
|
2023-04-14 12:30:14 +02:00
|
|
|
required: true
|
2023-03-02 17:54:57 +01:00
|
|
|
# Protect reprepro database using concurrency
|
|
|
|
concurrency: reprepro
|
|
|
|
jobs:
|
|
|
|
reprepro:
|
|
|
|
name: Deploy debian package
|
|
|
|
environment: packages.element.io
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-04-14 12:30:14 +02:00
|
|
|
R2_INCOMING_BUCKET: ${{ vars.R2_INCOMING_BUCKET }}
|
|
|
|
R2_URL: ${{ vars.CF_R2_S3_API }}
|
2023-03-02 17:54:57 +01:00
|
|
|
steps:
|
2023-04-14 12:30:14 +02:00
|
|
|
- name: Download artifact
|
2023-03-02 17:54:57 +01:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ inputs.artifact-name }}
|
|
|
|
path: dist
|
|
|
|
|
2023-04-14 12:30:14 +02:00
|
|
|
- name: Upload incoming deb
|
|
|
|
id: upload
|
2023-03-02 17:54:57 +01:00
|
|
|
run: |
|
2023-04-14 13:21:19 +02:00
|
|
|
deb="$(ls *.deb | tail -n1)"
|
2023-04-14 12:30:14 +02:00
|
|
|
echo "incoming=$deb" >> $GITHUB_OUTPUT
|
|
|
|
aws s3 cp "$deb" "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto
|
2023-04-14 13:21:19 +02:00
|
|
|
working-directory: dist
|
2023-03-02 17:54:57 +01:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
|
|
|
|
2023-04-14 12:30:14 +02:00
|
|
|
- name: Notify packages.element.io of incoming deb
|
2023-09-06 14:41:51 +02:00
|
|
|
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
|
2023-04-14 12:30:14 +02:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
repository: vector-im/packages.element.io
|
|
|
|
event-type: reprepro-incoming
|
|
|
|
client-payload: '{"incoming": "${{ steps.upload.outputs.incoming }}"}'
|