Skip to content

Commit

Permalink
fix: artifacts.yml action
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Aug 1, 2024
1 parent 11e33f9 commit 79ef0ac
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
- name: Upload Artifact to AWS S3
run: |
aws s3 cp ${{ env.ARTIFACT_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}
- name: Set Artifact Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "${{ env.ARTIFACT_NAME }}" \
Expand All @@ -53,13 +49,10 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
module: [ infrastructure/tools/keystore-generator, p2p/integrationtest/real-bidder, p2p/integrationtest/provider, bridge/standard/bridge-v1, external/geth, oracle, p2p]
module: [ infrastructure/tools/keystore-generator]
# module: [ infrastructure/tools/keystore-generator, p2p/integrationtest/real-bidder, p2p/integrationtest/provider, bridge/standard/bridge-v1, external/geth, oracle, p2p]

steps:
- name: Set Snapshot Flag
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "FLAGS=--snapshot" >> ${GITHUB_ENV}

- name: Checkout Code
uses: actions/checkout@v4
with:
Expand All @@ -86,7 +79,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean ${{ env.FLAGS }}
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -99,19 +92,10 @@ jobs:

- name: Upload Artifacts to AWS S3
run: |
aws s3 cp ./dist/ s3://${{ secrets.AWS_S3_BUCKET }} \
--recursive \
--exclude "*" \
--include "*.gz" \
--include "*.txt" \
- name: Set Artifacts Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
ls -1 ./dist | grep '\.gz\|\.txt$' | while read -r file; do
echo "Tagging uploaded file $file for auto delete"
aws s3api put-object-tagging \
set -x
find /tmp/dist -type f \( -name "*.gz" -o -name "*.txt" \) \
-exec aws s3 cp {} s3://${{ secrets.AWS_S3_BUCKET }}/ \; \
-exec aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "$file" \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]'
done
--key {} \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]' \;

0 comments on commit 79ef0ac

Please sign in to comment.