Skip to content

Commit b084e54

Browse files
committed
Probably regret breaking apart job into two
1 parent 543daa8 commit b084e54

1 file changed

Lines changed: 27 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Package
1+
name: Package and Upload
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77
branches: ["main"]
88

99
jobs:
10-
build:
10+
package:
1111
env:
1212
# Set the version of ruby-install to use
1313
RUBY_INSTALL_VERSION: 0.9.4
@@ -61,23 +61,35 @@ jobs:
6161
name: build-${{ matrix.os }}-${{ matrix.arch }}
6262
path: build/build.tar.gz
6363

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
6681
env:
67-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
6882
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 }}
7085
run: |
7186
# Use the GitHub Actions run ID as the build ID
7287
BUILD_ID=${{ github.run_id }}
7388
TARGET_DIR="builds/$BUILD_ID"
7489
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

Comments
 (0)