| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent caf71e0 commit e658208
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ permissions: | |||
| 10 | 10 | contents: read | |
| 11 | 11 | ||
| 12 | 12 | jobs: | |
| 13 | - openssl-v3-update: | ||
| 13 | + openssl-update: | ||
| 14 | 14 | if: github.repository == 'nodejs/node' | |
| 15 | 15 | runs-on: ubuntu-latest | |
| 16 | 16 | steps: | |
@@ -19,7 +19,7 @@ jobs: | |||
| 19 | 19 | persist-credentials: false | |
| 20 | 20 | - name: Check and download new OpenSSL version | |
| 21 | 21 | run: | | |
| 22 | - ./tools/dep_updaters/update-openssl.sh download_v3 > temp-output | ||
| 22 | + ./tools/dep_updaters/update-openssl.sh download > temp-output | ||
| 23 | 23 | cat temp-output | |
| 24 | 24 | tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | |
| 25 | 25 | rm temp-output | |
@@ -58,52 +58,3 @@ jobs: | |||
| 58 | 58 | branch: actions/tools-update-openssl # Custom branch *just* for this Action. | |
| 59 | 59 | commit-message: 'deps: update archs files for openssl-${{ env.NEW_VERSION }}' | |
| 60 | 60 | path: deps/openssl | |
| 61 | - openssl-v1-update: | ||
| 62 | - if: github.repository == 'nodejs/node' | ||
| 63 | - runs-on: ubuntu-latest | ||
| 64 | - steps: | ||
| 65 | - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
| 66 | - with: | ||
| 67 | - persist-credentials: false | ||
| 68 | - ref: v16.x-staging | ||
| 69 | - - name: Check and download new OpenSSL version | ||
| 70 | - run: | | ||
| 71 | - ./tools/dep_updaters/update-openssl.sh download_v1 > temp-output | ||
| 72 | - cat temp-output | ||
| 73 | - tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | ||
| 74 | - rm temp-output | ||
| 75 | - env: | ||
| 76 | - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
| 77 | - - name: Create PR with first commit | ||
| 78 | - if: env.NEW_VERSION | ||
| 79 | - uses: gr2m/create-or-update-pull-request-action@df20b2c073090271599a08c55ae26e0c3522b329 # v1.9.2 | ||
| 80 | - # Creates a PR with the new OpenSSL source code committed | ||
| 81 | - env: | ||
| 82 | - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
| 83 | - with: | ||
| 84 | - author: Node.js GitHub Bot <github-bot@iojs.org> | ||
| 85 | - body: This is an automated update of OpenSSL to ${{ env.NEW_VERSION }}. | ||
| 86 | - branch: actions/tools-update-openssl-v1 # Custom branch *just* for this Action. | ||
| 87 | - commit-message: 'deps: upgrade openssl sources to quictls/openssl-${{ env.NEW_VERSION }}' | ||
| 88 | - labels: dependencies | ||
| 89 | - title: '[v16.x] deps: update OpenSSL to ${{ env.NEW_VERSION }}' | ||
| 90 | - path: deps/openssl | ||
| 91 | - update-pull-request-title-and-body: true | ||
| 92 | - - name: Regenerate platform specific files | ||
| 93 | - if: env.NEW_VERSION | ||
| 94 | - run: | | ||
| 95 | - sudo apt install -y nasm libtext-template-perl | ||
| 96 | - ./tools/dep_updaters/update-openssl.sh regenerate | ||
| 97 | - env: | ||
| 98 | - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
| 99 | - - name: Add second commit | ||
| 100 | - # Adds a second commit to the PR with the generated platform-dependent files | ||
| 101 | - if: env.NEW_VERSION | ||
| 102 | - uses: gr2m/create-or-update-pull-request-action@df20b2c073090271599a08c55ae26e0c3522b329 # v1.9.2 | ||
| 103 | - env: | ||
| 104 | - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
| 105 | - with: | ||
| 106 | - author: Node.js GitHub Bot <github-bot@iojs.org> | ||
| 107 | - branch: actions/tools-update-openssl-v1 # Custom branch *just* for this Action. | ||
| 108 | - commit-message: 'deps: update archs files for openssl-${{ env.NEW_VERSION }}' | ||
| 109 | - path: deps/openssl | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,80 +9,26 @@ cleanup() { | |||
| 9 | 9 | exit $EXIT_CODE | |
| 10 | 10 | } | |
| 11 | 11 | ||
| 12 | - download_v1() { | ||
| 13 | - LATEST_V1_TAG_NAME="$("$NODE" --input-type=module <<'EOF' | ||
| 14 | - const res = await fetch('https://api.github.com/repos/quictls/openssl/git/matching-refs/tags/OpenSSL_1'); | ||
| 15 | - if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | ||
| 16 | - const releases = await res.json() | ||
| 17 | - const latest = releases.findLast(({ ref }) => ref.includes('quic')); | ||
| 18 | - if(!latest) throw new Error(`Could not find latest release for v1`); | ||
| 19 | - console.log(latest.ref.replace('refs/tags/','')); | ||
| 20 | - EOF | ||
| 21 | - )" | ||
| 22 | - | ||
| 23 | - NEW_VERSION_V1=$(echo "$LATEST_V1_TAG_NAME" | sed 's/OpenSSL_//;s/_/./g;s/-/+/g') | ||
| 24 | - | ||
| 25 | - case "$NEW_VERSION_V1" in | ||
| 26 | - *quic1) NEW_VERSION_V1_NO_RELEASE="${NEW_VERSION_V1%1}" ;; | ||
| 27 | - *) NEW_VERSION_V1_NO_RELEASE="$NEW_VERSION_V1" ;; | ||
| 28 | - esac | ||
| 29 | - | ||
| 30 | - VERSION_H="$DEPS_DIR/openssl/openssl/include/openssl/opensslv.h" | ||
| 31 | - CURRENT_VERSION=$(grep "OPENSSL_VERSION_TEXT" "$VERSION_H" | sed -n "s/.*OpenSSL \([^\"]*\).*/\1/p" | cut -d ' ' -f 1) | ||
| 32 | - | ||
| 33 | - # This function exit with 0 if new version and current version are the same | ||
| 34 | - compare_dependency_version "openssl" "$NEW_VERSION_V1_NO_RELEASE" "$CURRENT_VERSION" | ||
| 35 | - | ||
| 36 | - echo "Making temporary workspace..." | ||
| 37 | - WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
| 38 | - cd "$WORKSPACE" | ||
| 39 | - | ||
| 40 | - echo "Fetching OpenSSL source archive..." | ||
| 41 | - OPENSSL_TARBALL="openssl.tar.gz" | ||
| 42 | - curl -sL -o "$OPENSSL_TARBALL" "https://api.github.com/repos/quictls/openssl/tarball/$LATEST_V1_TAG_NAME" | ||
| 43 | - log_and_verify_sha256sum "openssl" "$OPENSSL_TARBALL" | ||
| 44 | - gzip -dc "$OPENSSL_TARBALL" | tar xf - | ||
| 45 | - rm "$OPENSSL_TARBALL" | ||
| 46 | - | ||
| 47 | - mv quictls-openssl-* openssl | ||
| 48 | - | ||
| 49 | - echo "Replacing existing OpenSSL..." | ||
| 50 | - rm -rf "$DEPS_DIR/openssl/openssl" | ||
| 51 | - mv "$WORKSPACE/openssl" "$DEPS_DIR/openssl/" | ||
| 52 | - | ||
| 53 | - echo "All done!" | ||
| 54 | - echo "" | ||
| 55 | - echo "Please git add openssl, and commit the new version:" | ||
| 56 | - echo "" | ||
| 57 | - echo "$ git add -A deps/openssl/openssl" | ||
| 58 | - echo "$ git add doc/contributing/maintaining/maintaining-dependencies.md" | ||
| 59 | - echo "$ git commit -m \"deps: upgrade openssl sources to quictls/openssl-$NEW_VERSION_V1\"" | ||
| 60 | - echo "" | ||
| 61 | - # The last line of the script should always print the new version, | ||
| 62 | - # as we need to add it to $GITHUB_ENV variable. | ||
| 63 | - echo "NEW_VERSION=$NEW_VERSION_V1" | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - download_v3() { | ||
| 67 | - LATEST_V3_TAG_NAME="$("$NODE" --input-type=module <<'EOF' | ||
| 12 | + download() { | ||
| 13 | + LATEST_TAG_NAME="$("$NODE" --input-type=module <<'EOF' | ||
| 68 | 14 | const res = await fetch('https://api.github.com/repos/quictls/openssl/git/matching-refs/tags/openssl-3.0'); | |
| 69 | 15 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | |
| 70 | 16 | const releases = await res.json() | |
| 71 | 17 | const latest = releases.findLast(({ ref }) => ref.includes('quic')); | |
| 72 | - if(!latest) throw new Error(`Could not find latest release for v3.0`); | ||
| 18 | + if(!latest) throw new Error(`Could not find latest release`); | ||
| 73 | 19 | console.log(latest.ref.replace('refs/tags/','')); | |
| 74 | 20 | EOF | |
| 75 | 21 | )" | |
| 76 | - NEW_VERSION_V3=$(echo "$LATEST_V3_TAG_NAME" | sed 's/openssl-//;s/-/+/g') | ||
| 22 | + NEW_VERSION=$(echo "$LATEST_TAG_NAME" | sed 's/openssl-//;s/-/+/g') | ||
| 77 | 23 | ||
| 78 | - case "$NEW_VERSION_V3" in | ||
| 79 | - *quic1) NEW_VERSION_V3_NO_RELEASE="${NEW_VERSION_V3%1}" ;; | ||
| 80 | - *) NEW_VERSION_V3_NO_RELEASE="$NEW_VERSION_V3" ;; | ||
| 24 | + case "$NEW_VERSION" in | ||
| 25 | + *quic1) NEW_VERSION_NO_RELEASE="${NEW_VERSION%1}" ;; | ||
| 26 | + *) NEW_VERSION_NO_RELEASE="$NEW_VERSION" ;; | ||
| 81 | 27 | esac | |
| 82 | 28 | VERSION_H="./deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h" | |
| 83 | 29 | CURRENT_VERSION=$(grep "OPENSSL_FULL_VERSION_STR" $VERSION_H | sed -n "s/^.*VERSION_STR \"\(.*\)\"/\1/p") | |
| 84 | 30 | # This function exit with 0 if new version and current version are the same | |
| 85 | - compare_dependency_version "openssl" "$NEW_VERSION_V3_NO_RELEASE" "$CURRENT_VERSION" | ||
| 31 | + compare_dependency_version "openssl" "$NEW_VERSION_NO_RELEASE" "$CURRENT_VERSION" | ||
| 86 | 32 | ||
| 87 | 33 | echo "Making temporary workspace..." | |
| 88 | 34 | ||
@@ -93,7 +39,7 @@ EOF | |||
| 93 | 39 | ||
| 94 | 40 | OPENSSL_TARBALL="openssl.tar.gz" | |
| 95 | 41 | ||
| 96 | - curl -sL -o "$OPENSSL_TARBALL" "https://api.github.com/repos/quictls/openssl/tarball/$LATEST_V3_TAG_NAME" | ||
| 42 | + curl -sL -o "$OPENSSL_TARBALL" "https://api.github.com/repos/quictls/openssl/tarball/$LATEST_TAG_NAME" | ||
| 97 | 43 | ||
| 98 | 44 | log_and_verify_sha256sum "openssl" "$OPENSSL_TARBALL" | |
| 99 | 45 | ||
@@ -110,11 +56,11 @@ EOF | |||
| 110 | 56 | echo "Please git add openssl, and commit the new version:" | |
| 111 | 57 | echo "" | |
| 112 | 58 | echo "$ git add -A deps/openssl/openssl" | |
| 113 | - echo "$ git commit -m \"deps: upgrade openssl sources to quictls/openssl-$NEW_VERSION_V3\"" | ||
| 59 | + echo "$ git commit -m \"deps: upgrade openssl sources to quictls/openssl-$NEW_VERSION\"" | ||
| 114 | 60 | echo "" | |
| 115 | 61 | # The last line of the script should always print the new version, | |
| 116 | 62 | # as we need to add it to $GITHUB_ENV variable. | |
| 117 | - echo "NEW_VERSION=$NEW_VERSION_V3" | ||
| 63 | + echo "NEW_VERSION=$NEW_VERSION" | ||
| 118 | 64 | } | |
| 119 | 65 | ||
| 120 | 66 | regenerate() { | |
@@ -168,7 +114,7 @@ main() { | |||
| 168 | 114 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | |
| 169 | 115 | ||
| 170 | 116 | case ${1} in | |
| 171 | - help | regenerate | download_v1 | download_v3 ) | ||
| 117 | + help | regenerate | download ) | ||
| 172 | 118 | $1 "${2}" | |
| 173 | 119 | ;; | |
| 174 | 120 | * ) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments