Skip to content

Commit 03a8590

Browse files
authored
add an aws-lc auto-bump script (#12890)
* add an aws-lc auto-bump script * merge it all into one uber script * one more
1 parent 1597c27 commit 03a8590

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/boring-open-version-bump.yml renamed to .github/workflows/boring-open-awslc-bump.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Bump BoringSSL and/or OpenSSL
1+
name: Bump BoringSSL, OpenSSL, AWS-LC
22
permissions:
33
contents: read
44

@@ -38,6 +38,18 @@ jobs:
3838
echo -e "## OpenSSL\n[Commit: ${SHA}](https://github.com/openssl/openssl/commit/${SHA})\n\n[Diff](https://github.com/openssl/openssl/compare/${LAST_COMMIT}...${SHA}) between the last commit hash merged to this repository and the new commit." >> $GITHUB_OUTPUT
3939
echo "EOF" >> $GITHUB_OUTPUT
4040
fi
41+
- id: check-tag-aws-lc
42+
run: |
43+
# Get the latest tag from AWS-LC repository
44+
LATEST_TAG=$(git ls-remote --tags https://github.com/aws/aws-lc.git | grep -o 'refs/tags/v[0-9\.]*$' | sort -V | tail -1 | sed 's|refs/tags/||')
45+
CURRENT_TAG=$(grep aws-lc .github/workflows/ci.yml | grep VERSION | grep -o 'v[0-9\.]*')
46+
47+
if [ "$LATEST_TAG" != "$CURRENT_TAG" ]; then
48+
echo "NEW_TAG=${LATEST_TAG}" >> $GITHUB_OUTPUT
49+
echo "COMMIT_MSG<<EOF" >> $GITHUB_OUTPUT
50+
echo -e "## AWS-LC\n[Tag: ${LATEST_TAG}](https://github.com/aws/aws-lc/releases/tag/${LATEST_TAG})\n\n[Diff](https://github.com/aws/aws-lc/compare/${CURRENT_TAG}...${LATEST_TAG}) between the previously used tag and the new tag." >> $GITHUB_OUTPUT
51+
echo "EOF" >> $GITHUB_OUTPUT
52+
fi
4153
- name: Update boring
4254
run: |
4355
set -xe
@@ -58,6 +70,16 @@ jobs:
5870
if: steps.check-sha-openssl.outputs.COMMIT_SHA
5971
env:
6072
COMMIT_SHA: ${{ steps.check-sha-openssl.outputs.COMMIT_SHA }}
73+
- name: Update AWS-LC
74+
run: |
75+
set -xe
76+
CURRENT_DATE=$(date "+%b %d, %Y")
77+
sed -E -i "s/Latest tag of AWS-LC main branch, as of .*/Latest tag of AWS-LC main branch, as of ${CURRENT_DATE}./" .github/workflows/ci.yml
78+
sed -E -i "s/TYPE: \"aws-lc\", VERSION: \"v[0-9\.]*\"/TYPE: \"aws-lc\", VERSION: \"${NEW_TAG}\"/" .github/workflows/ci.yml
79+
git status
80+
if: steps.check-tag-aws-lc.outputs.NEW_TAG
81+
env:
82+
NEW_TAG: ${{ steps.check-tag-aws-lc.outputs.NEW_TAG }}
6183
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
6284
id: generate-token
6385
with:
@@ -68,11 +90,12 @@ jobs:
6890
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
6991
with:
7092
branch: "bump-openssl-boringssl"
71-
commit-message: "Bump BoringSSL and/or OpenSSL in CI"
93+
commit-message: "Bump BoringSSL, OpenSSL, AWS-LC in CI"
7294
title: "Bump BoringSSL and/or OpenSSL in CI"
7395
author: "pyca-boringbot[bot] <pyca-boringbot[bot][email protected]>"
7496
body: |
7597
${{ steps.check-sha-boring.outputs.COMMIT_MSG }}
7698
${{ steps.check-sha-openssl.outputs.COMMIT_MSG }}
99+
${{ steps.check-tag-aws-lc.outputs.COMMIT_MSG }}
77100
token: ${{ steps.generate-token.outputs.token }}
78-
if: steps.check-sha-boring.outputs.COMMIT_SHA || steps.check-sha-openssl.outputs.COMMIT_SHA
101+
if: steps.check-sha-boring.outputs.COMMIT_SHA || steps.check-sha-openssl.outputs.COMMIT_SHA || steps.check-tag-aws-lc.outputs.NEW_TAG

0 commit comments

Comments
 (0)