From 036da58d308df36203b000b44b1c67c30cfa6d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Sa=C4=8Dari=C4=87?= Date: Sat, 22 Jul 2023 19:21:17 +0200 Subject: [PATCH] Add standalone upload to S3 workflow (#866) --- .github/workflows/package_all.yaml | 4 ++-- .github/workflows/upload_to_s3.yaml | 32 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/upload_to_s3.yaml diff --git a/.github/workflows/package_all.yaml b/.github/workflows/package_all.yaml index 7e8340e39..323303c8f 100644 --- a/.github/workflows/package_all.yaml +++ b/.github/workflows/package_all.yaml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: memgraph_version: - description: "Memgraph version to upload as. If empty upload is skipped. Format: 'vX.Y.Z'" + description: "Memgraph version to upload as. If empty upload is skipped. Format: 'X.Y.Z'" required: false jobs: @@ -253,4 +253,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }} AWS_REGION: "eu-west-1" SOURCE_DIR: "build/output/release" - DEST_DIR: "memgraph/${{ github.event.inputs.memgraph_version }}/" + DEST_DIR: "memgraph/v${{ github.event.inputs.memgraph_version }}/" diff --git a/.github/workflows/upload_to_s3.yaml b/.github/workflows/upload_to_s3.yaml new file mode 100644 index 000000000..978af7d66 --- /dev/null +++ b/.github/workflows/upload_to_s3.yaml @@ -0,0 +1,32 @@ +name: Upload Package All artifacts to S3 + +on: + workflow_dispatch: + inputs: + memgraph_version: + description: "Memgraph version to upload as. Format: 'X.Y.Z'" + required: true + run_number: + description: "# of the package_all workflow run to upload artifacts from. Format: '#XYZ'" + required: true + +jobs: + upload-to-s3: + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: dawidd6/action-download-artifact@v2 + with: + workflow: package_all.yaml + workflow_conclusion: success + run_number: "${{ github.event.inputs.run_number }}" + path: build/output/release + - name: Upload to S3 + uses: jakejarvis/s3-sync-action@v0.5.1 + env: + AWS_S3_BUCKET: "download.memgraph.com" + AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }} + AWS_REGION: "eu-west-1" + SOURCE_DIR: "build/output/release" + DEST_DIR: "memgraph/v${{ github.event.inputs.memgraph_version }}/"