-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #48377 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
- Loading branch information
1 parent
8e710c9
commit 51ca71c
Showing
2 changed files
with
150 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,35 +10,23 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
openssl-update: | ||
openssl-v3-update: | ||
if: github.repository == 'nodejs/node' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
persist-credentials: false | ||
- name: Check if update branch already exists | ||
run: | | ||
BRANCH_EXISTS=$(git ls-remote --heads origin actions/tools-update-openssl) | ||
echo "BRANCH_EXISTS=$BRANCH_EXISTS" >> $GITHUB_ENV | ||
- name: Check and download new OpenSSL version | ||
# Only run rest of the workflow if the update branch does not yet exist | ||
if: ${{ env.BRANCH_EXISTS == '' }} | ||
run: | | ||
NEW_VERSION=$(gh api repos/quictls/openssl/releases -q '.[].tag_name|select(contains("openssl-3"))|ltrimstr("openssl-")' | head -n1) | ||
NEW_VERSION_NO_RELEASE_1=$(case $NEW_VERSION in *quic1) echo ${NEW_VERSION%1};; *) echo $NEW_VERSION;; esac) | ||
VERSION_H="./deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h" | ||
CURRENT_VERSION=$(grep "OPENSSL_FULL_VERSION_STR" $VERSION_H | sed -n "s/^.*VERSION_STR \"\(.*\)\"/\1/p" | sed 's/+/-/g') | ||
echo "comparing current version: $CURRENT_VERSION with $NEW_VERSION_NO_RELEASE_1" | ||
if [ "$NEW_VERSION_NO_RELEASE_1" != "$CURRENT_VERSION" ]; then | ||
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | ||
echo "HAS_UPDATE=true" >> $GITHUB_ENV | ||
./tools/dep_updaters/update-openssl.sh download "$NEW_VERSION" | ||
fi | ||
./tools/dep_updaters/update-openssl.sh download_v3 > temp-output | ||
cat temp-output | ||
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | ||
rm temp-output | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
- name: Create PR with first commit | ||
if: env.HAS_UPDATE | ||
if: env.NEW_VERSION | ||
uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5 | ||
# Creates a PR with the new OpenSSL source code committed | ||
env: | ||
|
@@ -53,15 +41,15 @@ jobs: | |
path: deps/openssl | ||
update-pull-request-title-and-body: true | ||
- name: Regenerate platform specific files | ||
if: env.HAS_UPDATE | ||
if: env.NEW_VERSION | ||
run: | | ||
sudo apt install -y nasm libtext-template-perl | ||
./tools/dep_updaters/update-openssl.sh regenerate | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
- name: Add second commit | ||
# Adds a second commit to the PR with the generated platform-dependent files | ||
if: env.HAS_UPDATE | ||
if: env.NEW_VERSION | ||
uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
|
@@ -70,3 +58,52 @@ jobs: | |
branch: actions/tools-update-openssl # Custom branch *just* for this Action. | ||
commit-message: 'deps: update archs files for openssl-${{ env.NEW_VERSION }}' | ||
path: deps/openssl | ||
openssl-v1-update: | ||
if: github.repository == 'nodejs/node' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
persist-credentials: false | ||
ref: v16.x-staging | ||
- name: Check and download new OpenSSL version | ||
run: | | ||
./tools/dep_updaters/update-openssl.sh download_v1 > temp-output | ||
cat temp-output | ||
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | ||
rm temp-output | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
- name: Create PR with first commit | ||
if: env.NEW_VERSION | ||
uses: gr2m/create-or-update-pull-request-action@df20b2c073090271599a08c55ae26e0c3522b329 # v1.9.2 | ||
# Creates a PR with the new OpenSSL source code committed | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
with: | ||
author: Node.js GitHub Bot <[email protected]> | ||
body: This is an automated update of OpenSSL to ${{ env.NEW_VERSION }}. | ||
branch: actions/tools-update-openssl-v1 # Custom branch *just* for this Action. | ||
commit-message: 'deps: upgrade openssl sources to quictls/openssl-${{ env.NEW_VERSION }}' | ||
labels: dependencies | ||
title: '[v16.x] deps: update OpenSSL to ${{ env.NEW_VERSION }}' | ||
path: deps/openssl | ||
update-pull-request-title-and-body: true | ||
- name: Regenerate platform specific files | ||
if: env.NEW_VERSION | ||
run: | | ||
sudo apt install -y nasm libtext-template-perl | ||
./tools/dep_updaters/update-openssl.sh regenerate | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
- name: Add second commit | ||
# Adds a second commit to the PR with the generated platform-dependent files | ||
if: env.NEW_VERSION | ||
uses: gr2m/create-or-update-pull-request-action@df20b2c073090271599a08c55ae26e0c3522b329 # v1.9.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
with: | ||
author: Node.js GitHub Bot <[email protected]> | ||
branch: actions/tools-update-openssl-v1 # Custom branch *just* for this Action. | ||
commit-message: 'deps: update archs files for openssl-${{ env.NEW_VERSION }}' | ||
path: deps/openssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters