From a72c6c0322952247ba90542ce628ed9c89df3659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 2 Oct 2023 08:29:00 +0200 Subject: [PATCH] Add action job to upload artifacts to R2 (#2779) --- .github/workflows/build.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 97fdbd547..602cf9b4c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,6 +12,9 @@ on: required: false type: string +env: + PYTHON_VERSION: "3.10" + jobs: prepare: name: Prepare build @@ -141,6 +144,16 @@ jobs: submodules: true persist-credentials: false + - name: Setup Python version ${{ env.PYTHON_VERSION }} + if: ${{ github.event_name != 'release' }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install AWS CLI + if: ${{ github.event_name != 'release' }} + run: pip install awscli + - name: Set version suffix if: ${{ github.event_name != 'release' }} env: @@ -200,6 +213,19 @@ jobs: remote_user: ${{ secrets.DEV_USERNAME }} remote_key: ${{ secrets.DEV_SSH_KEY }} + - name: Upload artifacts + if: ${{ github.event_name != 'release' }} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.R2_OS_ARTIFACTS_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_OS_ARTIFACTS_KEY }} + run: | + aws s3 sync \ + output/images/ \ + s3://${{ secrets.R2_OS_ARTIFACTS_BUCKET }}/${{ needs.prepare.outputs.version_full }}/ \ + --exclude "*" \ + --include "haos_*" \ + --endpoint-url ${{ secrets.R2_OS_ARTIFACTS_ENDPOINT }} + - name: Upload release assets if: ${{ github.event_name == 'release' }} uses: shogo82148/actions-upload-release-asset@v1