From d65a7ca85fc14f9002cc37b19865672c1630b829 Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Fri, 6 Mar 2026 14:21:24 -0500 Subject: [PATCH 1/2] Add S3 upload workflow for merged PRs Uploads icons and EHLDs to S3 when a PR is merged to main. Only uploads if VERSION matches the next release (production + 1). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/upload-to-s3.yml | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/upload-to-s3.yml diff --git a/.github/workflows/upload-to-s3.yml b/.github/workflows/upload-to-s3.yml new file mode 100644 index 0000000..d1f9378 --- /dev/null +++ b/.github/workflows/upload-to-s3.yml @@ -0,0 +1,49 @@ +name: Upload illustrations to S3 + +on: + pull_request: + branches: [main] + types: [closed] + +jobs: + upload: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + + - name: Check version is next release + run: | + REPO_VERSION=$(cat VERSION | tr -d '[:space:]') + PROD_VERSION=$(curl -s https://reactome.org/ContentService/data/database/version | tr -d '[:space:]') + EXPECTED_VERSION=$((PROD_VERSION + 1)) + + echo "Repo VERSION: $REPO_VERSION" + echo "Production version: $PROD_VERSION" + echo "Expected next version: $EXPECTED_VERSION" + + if [ "$REPO_VERSION" != "$EXPECTED_VERSION" ]; then + echo "::error::VERSION ($REPO_VERSION) does not match expected next release ($EXPECTED_VERSION). Skipping upload." + exit 1 + fi + + echo "VERSION=$REPO_VERSION" >> $GITHUB_ENV + + - uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ vars.AWS_ROLE }} + aws-region: us-east-1 + + - name: Upload icons to S3 + run: | + aws s3 sync icons/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/icons/svg/" \ + --exclude "*.xml" \ + --delete + + - name: Upload EHLDs to S3 + run: | + aws s3 sync ehld/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/ehld/" \ + --delete From cc78a3c4e221e66b163f8e371426f332b42a640d Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Fri, 6 Mar 2026 14:25:46 -0500 Subject: [PATCH 2/2] Update S3 upload workflow to include XML files Removed exclusion of XML files from S3 upload. --- .github/workflows/upload-to-s3.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/upload-to-s3.yml b/.github/workflows/upload-to-s3.yml index d1f9378..bd502a6 100644 --- a/.github/workflows/upload-to-s3.yml +++ b/.github/workflows/upload-to-s3.yml @@ -40,7 +40,6 @@ jobs: - name: Upload icons to S3 run: | aws s3 sync icons/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/icons/svg/" \ - --exclude "*.xml" \ --delete - name: Upload EHLDs to S3