|
1 | | -name: Package |
| 1 | +name: Package and Upload |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
7 | 7 | branches: ["main"] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build: |
| 10 | + package: |
11 | 11 | env: |
12 | 12 | # Set the version of ruby-install to use |
13 | 13 | RUBY_INSTALL_VERSION: 0.9.4 |
@@ -61,23 +61,35 @@ jobs: |
61 | 61 | name: build-${{ matrix.os }}-${{ matrix.arch }} |
62 | 62 | path: build/build.tar.gz |
63 | 63 |
|
64 | | - # Step 7: Upload to S3-compatible bucket |
65 | | - - name: Upload artifacts to S3 bucket |
| 64 | + upload: |
| 65 | + needs: package |
| 66 | + runs-on: ubuntu-latest |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Download build artifacts |
| 70 | + uses: actions/download-artifact@v3 |
| 71 | + with: |
| 72 | + path: artifacts/ |
| 73 | + |
| 74 | + - name: List downloaded artifacts |
| 75 | + run: | |
| 76 | + echo "Downloaded artifacts:" |
| 77 | + ls -R artifacts/ |
| 78 | +
|
| 79 | + # Upload to S3-compatible bucket |
| 80 | + - name: Upload artifacts to Tigris |
66 | 81 | env: |
67 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
68 | 82 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
69 | | - S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} |
| 83 | + S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }} |
| 84 | + AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }} |
70 | 85 | run: | |
71 | 86 | # Use the GitHub Actions run ID as the build ID |
72 | 87 | BUILD_ID=${{ github.run_id }} |
73 | 88 | TARGET_DIR="builds/$BUILD_ID" |
74 | 89 |
|
75 | | - # Ensure the artifacts directory exists |
76 | | - if [ ! -f build/build.tar.gz ]; then |
77 | | - echo "Artifact file not found: build/build.tar.gz" |
78 | | - exit 1 |
79 | | - fi |
80 | | -
|
81 | | - # Upload artifact to S3 |
82 | | - echo "Uploading build artifact to S3 bucket" |
83 | | - aws s3 cp build/build.tar.gz "$AWS_ENDPOINT_URL_S3/$TARGET_DIR/build-${{ matrix.os }}-${{ matrix.arch }}.tar.gz" --acl public-read |
| 90 | + # Upload each artifact to Tigris |
| 91 | + find artifacts -type f | while read file; do |
| 92 | + BASENAME=$(basename "$file") |
| 93 | + echo "Uploading $BASENAME to S3 bucket" |
| 94 | + aws s3 cp "$file" "s3://$S3_BUCKET_NAME/$TARGET_DIR/$BASENAME" --acl public-read |
| 95 | + done |
0 commit comments