-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (89 loc) · 3.17 KB
/
artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: artifacts
on:
workflow_dispatch
permissions:
contents: read
jobs:
upload_contracts:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1
- name: Create Artifact
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION_TAG="${GITHUB_REF#refs/tags/v}"
else
VERSION_TAG=$(echo "${GITHUB_SHA:0:7}")
fi
ARTIFACT_NAME="contracts_${VERSION_TAG}.tar.gz"
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> ${GITHUB_ENV}
tar -czvf ${ARTIFACT_NAME} ./contracts
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-2'
- name: Upload Artifact to AWS S3
run: |
aws s3 cp ${{ env.ARTIFACT_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "${{ env.ARTIFACT_NAME }}" \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]'
upload_binaries:
runs-on: ubuntu-24.04
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]
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1
- name: Setup Cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.work.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
check-latest: true
cache-dependency-path: go.work.sum
- name: Build Artifacts
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-2'
- name: Upload Artifacts to AWS S3
run: |
find /tmp/dist -type f \( -name "*.gz" -o -name "*.txt" \) \
-exec sh -c '
file=$(basename "${1}")
echo "Uploading ${file} to S3..."
aws s3 cp "${1}" s3://${{ secrets.AWS_S3_BUCKET }}/ &&
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "${file}" \
--tagging "TagSet=[{Key=AutoDelete,Value=true}]"
' _ {} \;