@@ -42,33 +42,39 @@ jobs:
4242 steps :
4343 - name : Setup GitHub Token
4444 id : setup-github-token
45- uses : smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1
45+ uses : smartcontractkit/.github/actions/setup-github-token@setup-github-token/v1
4646 with :
4747 aws-role-arn : ${{ secrets.AWS_ROLE_ARN_GATI_CHANGESETS }}
4848 aws-lambda-url : ${{ secrets.AWS_LAMBDA_URL_GATI }}
4949 aws-region : ${{ secrets.AWS_REGION }}
5050
5151 - name : Checkout this repository
52- uses : actions/checkout@v4
52+ uses : actions/checkout@v6
5353 with :
5454 fetch-depth : 0
5555
5656 - name : Compute Docker Tag
5757 id : compute-docker-tag
58+ env :
59+ GITHUB_REF : ${{ github.ref }}
60+ GITHUB_REF_NAME : ${{ github.ref_name }}
61+ GITHUB_EVENT_NAME : ${{ github.event_name }}
62+ GITHUB_EVENT_INPUTS_VERSION : ${{ github.event.inputs.version }}
63+ NEXT_VERSION : ${{ env.NEXT_VERSION }}
5864 run : |
59- BRANCH_NAME=${{ github.ref_name } }
65+ BRANCH_NAME=${GITHUB_REF_NAME }
6066 SHORT_HASH=$(git rev-parse --short HEAD)
61- INPUT_VERSION="${{ github.event.inputs.version } }"
67+ INPUT_VERSION="${GITHUB_EVENT_INPUTS_VERSION }"
6268
6369 if [[ -n "$INPUT_VERSION" ]]; then
6470 IMAGE_TAG="${INPUT_VERSION}-aptos"
6571 elif [[ "$BRANCH_NAME" == "main" ]]; then
66- IMAGE_TAG="${{ env. NEXT_VERSION } }-aptos"
72+ IMAGE_TAG="${NEXT_VERSION}-aptos"
6773 elif [[ "$BRANCH_NAME" == "develop" ]]; then
68- IMAGE_TAG="${{ env. NEXT_VERSION } }-develop-${SHORT_HASH}-aptos"
74+ IMAGE_TAG="${NEXT_VERSION}-develop-${SHORT_HASH}-aptos"
6975 elif [[ "$BRANCH_NAME" == integration/* ]]; then
7076 INTEGRATION_NAME=${BRANCH_NAME#integration/}
71- IMAGE_TAG="${{ env. NEXT_VERSION } }-${INTEGRATION_NAME}-${SHORT_HASH}-aptos"
77+ IMAGE_TAG="${NEXT_VERSION}-${INTEGRATION_NAME}-${SHORT_HASH}-aptos"
7278 else
7379 echo "Branch '$BRANCH_NAME' does not match expected patterns"
7480 exit 0
@@ -79,39 +85,42 @@ jobs:
7985
8086 - name : Determine Chainlink CORE_REF
8187 id : determine-chainlink-core-ref
88+ env :
89+ INPUT_CORE_REF : ${{ github.event.inputs.core_ref }}
90+ APTOS_CORE_REF : ${{ env.APTOS_CORE_REF }}
8291 run : |
83- if [ -n "${{ github.event.inputs.core_ref } }" ]; then
84- echo "CORE_REF provided as input: ${{ github.event.inputs.core_ref } }"
85- echo "CORE_REF=${{ github.event.inputs.core_ref } }" >> $GITHUB_ENV
92+ if [ -n "${INPUT_CORE_REF }" ]; then
93+ echo "CORE_REF provided as input: ${INPUT_CORE_REF }"
94+ echo "CORE_REF=${INPUT_CORE_REF }" >> $GITHUB_ENV
8695 else
87- echo "No core_ref provided as input. Using default: ${{ env. APTOS_CORE_REF } }"
88- echo "CORE_REF=${{ env. APTOS_CORE_REF } }" >> $GITHUB_ENV
96+ echo "No core_ref provided as input. Using default: ${APTOS_CORE_REF}"
97+ echo "CORE_REF=${APTOS_CORE_REF}" >> $GITHUB_ENV
8998 fi
9099
91100 - name : Configure AWS Credentials
92- uses : aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
101+ uses : aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
93102 with :
94- aws-region : ${{ vars .AWS_REGION }}
103+ aws-region : ${{ secrets .AWS_REGION }}
95104 role-to-assume : ${{ secrets.AWS_ROLE_ARN_PROD_PUBLISH_ECR }}
96105 role-duration-seconds : 3600
97106 mask-aws-account-id : true
98107
99108 - name : Login to Amazon ECR
100109 id : login-ecr
101- uses : aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
110+ uses : aws-actions/amazon-ecr-login@f2e9fc6c2b355c1890b65e6f6f0e2ac3e6e22f78 # v2.1.2
102111 with :
103112 mask-password : " true"
104113 registries : " ${{ secrets.AWS_ACCOUNT_ID_PROD}},${{ secrets.QA_AWS_ACCOUNT_NUMBER }}"
105114
106115 - name : Set up Docker Buildx
107- uses : docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1 .0
116+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0 .0
108117
109118 # This is not the most efficient way to check if the image exist or not. I was having trouble using aws CLI due to missing permission. We could improve this in a next iteration.
110119 - name : Check if Aptos image already exists
111120 id : check-ecr-tag
121+ env :
122+ IMAGE_URI : ${{ format('{0}.dkr.ecr.{1}.amazonaws.com/chainlink-internal-integrations-aptos:{2}', secrets.AWS_ACCOUNT_ID_PROD, secrets.AWS_REGION, env.IMAGE_TAG) }}
112123 run : |
113- IMAGE_URI="${{ secrets.AWS_ACCOUNT_ID_PROD }}.dkr.ecr.${{ vars.AWS_REGION }}.amazonaws.com/chainlink-internal-integrations-aptos:${{ env.IMAGE_TAG }}"
114-
115124 # Try to pull the image
116125 if docker pull $IMAGE_URI; then
117126 echo "Image $IMAGE_URI already exists. Skipping image build and push."
@@ -125,7 +134,7 @@ jobs:
125134
126135 - name : Build and Push
127136 if : steps.check-ecr-tag.outputs.SKIP_IMAGE_BUILD == 'false'
128- uses : docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5 .1.0
137+ uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7 .1.0
129138 id : build-image
130139 with :
131140 context : ${{ github.workspace }}
@@ -138,11 +147,14 @@ jobs:
138147 - name : Determine if Prerelease
139148 if : steps.check-ecr-tag.outputs.SKIP_IMAGE_BUILD == 'false'
140149 id : determine-prerelease
150+ env :
151+ INPUT_PRERELEASE : ${{ github.event.inputs.prerelease }}
152+ GITHUB_REF_NAME : ${{ github.ref_name }}
141153 run : |
142- if [[ -n "${{ github.event.inputs.prerelease } }" ]]; then
143- PRERELEASE=${{ github.event.inputs.prerelease } }
154+ if [[ -n "${INPUT_PRERELEASE }" ]]; then
155+ PRERELEASE=${INPUT_PRERELEASE }
144156 echo "Using provided prerelease value: $PRERELEASE"
145- elif [[ "${{ github.ref_name } }" == "main" ]]; then
157+ elif [[ "${GITHUB_REF_NAME }" == "main" ]]; then
146158 PRERELEASE=false
147159 echo "Branch 'main' detected. Setting prerelease=false"
148160 else
@@ -154,7 +166,7 @@ jobs:
154166
155167 - name : Create a Release
156168 if : steps.check-ecr-tag.outputs.SKIP_IMAGE_BUILD == 'false'
157- uses : elgohr/Github-Release-Action@c5ea99036abb741a89f8bf1f2cd7fba845e3313a # v5 https://github.com/elgohr/Github-Release-Action/releases/tag/v5
169+ uses : elgohr/Github-Release-Action@3af318c9bb451e43ab8cea7fa17a5598abe94ed2 # 20240816194204
158170 env :
159171 GH_ENTERPRISE_TOKEN : ${{ steps.setup-github-token.outputs.access-token }}
160172 with :
0 commit comments