From 0153822d2e8b8edf4b16810c43919d59b10d27f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 22 Oct 2021 14:07:19 +0200 Subject: [PATCH 1/2] CI: Add c_release_binaries job that gathers release binaries from individual jobs --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++ ReleaseChecklist.md | 23 ++++-------------- 2 files changed, 61 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06213ebcbf47..51efa3345982 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -418,6 +418,13 @@ defaults: tags: only: /.*/ + - workflow_trigger_on_releases: &workflow_trigger_on_releases + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ + - workflow_ubuntu2004: &workflow_ubuntu2004 <<: *workflow_trigger_on_tags requires: @@ -1416,6 +1423,46 @@ jobs: path: all-bytecode-reports.zip - gitter_notify_failure_unless_pr + c_release_binaries: + <<: *base_ubuntu2004 + steps: + - checkout + - attach_workspace: + at: workspace + - run: + name: Gather and rename binaries from dependent jobs + command: | + mkdir github/ + cp workspace/solc/solc github/solc-static-linux + cp workspace/build/solc/solc github/solc-macos + cp workspace/solc/Release/solc.exe github/solc-windows.exe + cp workspace/soljson.js github/soljson.js + + cd github/ + tar --create --file ../github-binaries.tar * + - store_artifacts: + path: github-binaries.tar + - run: + name: Rename binaries to solc-bin naming convention + command: | + full_version=$( + github/solc-static-linux --version | + sed -En 's/^Version: ([0-9.]+.*\+commit\.[0-9a-f]+(\.mod)?).*$/\1/p' + ) + + mkdir -p solc-bin/{linux-amd64,macosx-amd64,windows-amd64,bin} + + mv github/solc-static-linux "solc-bin/linux-amd64/solc-linux-amd64-${full_version}" + mv github/solc-macos "solc-bin/macosx-amd64/solc-macosx-amd64-${full_version}" + mv github/solc-windows.exe "solc-bin/windows-amd64/solc-windows-amd64-${full_version}.exe" + mv github/soljson.js "solc-bin/bin/soljson-${full_version}.js" + + cd solc-bin/ + tar --create --file ../solc-bin-binaries.tar * + - store_artifacts: + path: solc-bin-binaries.tar + - gitter_notify_failure_unless_pr + workflows: version: 2 @@ -1536,6 +1583,15 @@ workflows: - b_bytecode_osx - b_bytecode_ems + # Final artifacts + - c_release_binaries: + <<: *workflow_trigger_on_releases + requires: + - b_ubu_static + - b_osx + - b_win_release + - b_ems + nightly: triggers: diff --git a/ReleaseChecklist.md b/ReleaseChecklist.md index 6d5008cb37fb..df72de4eeea9 100644 --- a/ReleaseChecklist.md +++ b/ReleaseChecklist.md @@ -26,29 +26,16 @@ - [ ] Click the `PUBLISH RELEASE` button on the release page, creating the tag. - [ ] Wait for the CI runs on the tag itself. -### Upload Release Artifacts +### Upload Release Artifacts and Publish Binaries - [ ] Switch to the tag that archives have to be created for. - [ ] Create the ``prerelease.txt`` file: (``echo -n > prerelease.txt``). - [ ] Run ``scripts/create_source_tarball.sh`` while being on the tag to create the source tarball. This will create the tarball in a directory called ``upload``. - [ ] Take the tarball from the upload directory (its name should be ``solidity_x.x.x.tar.gz``, otherwise ``prerelease.txt`` was missing in the step before) and upload the source tarball to the release page. - - [ ] Take the ``solc.exe`` binary from the ``b_win_release`` run of the released commit in circle-ci and add it to the release page as ``solc-windows.exe``. - - [ ] Take the ``solc`` binary from the ``b_osx`` run of the released commit in circle-ci and add it to the release page as ``solc-macos``. - - [ ] Take the ``solc`` binary from the ``b_ubu_static`` run of the released commit in circle-ci and add it to the release page as ``solc-static-linux``. - - [ ] Take the ``soljson.js`` binary from the ``b_ems`` run of the released commit in circle-ci and add it to the release page as ``soljson.js``. - -### Update [solc-bin](https://github.com/ethereum/solc-bin/) - - [ ] Copy files to solc-bin: - ```bash - VERSION=0.8.4 - COMMIT="c7e474f2" - SOLC_BIN="/home/me/solc-bin" - chmod +x solc-static-linux solc-macos - cp soljson.js $SOLC_BIN/bin/soljson-v$VERSION+commit.$COMMIT.js - cp solc-static-linux $SOLC_BIN/linux-amd64/solc-linux-amd64-v$VERSION+commit.$COMMIT - cp solc-macos $SOLC_BIN/macosx-amd64/solc-macosx-amd64-v$VERSION+commit.$COMMIT - cp solc-windows.exe $SOLC_BIN/windows-amd64/solc-windows-amd64-v$VERSION+commit.$COMMIT.exe + - [ ] Take the ``github-binaries.tar`` tarball from ``b_release_binaries`` run of the tagged commit in circle-ci and add all binaries from it to the release page. + Make sure it contains four binaries: ``solc-windows.exe``, ``solc-macos``, ``solc-static-linux`` and ``soljson.js``. + - [ ] Take the ``solc-bin-binaries.tar`` tarball from ``b_release_binaries`` run of the tagged commit in circle-ci and add all binaries from it to solc-bin. - [ ] Run ``./update --reuse-hashes`` in ``solc-bin`` and verify that the script has updated ``list.js``, ``list.txt`` and ``list.json`` files correctly and that symlinks to the new release have been added in ``solc-bin/wasm/`` and ``solc-bin/emscripten-wasm32/``. - - [ ] Create a pull request and merge. + - [ ] Create a pull request in solc-bin and merge. ### Homebrew and MacOS - [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in https://github.com/Homebrew/homebrew-core/blob/master/Formula/solidity.rb From dbcffb79a53b8ec6fd7386e7d4537a6b9d3b7af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 22 Oct 2021 14:44:21 +0200 Subject: [PATCH 2/2] CI: Post a notification to gitter when binaries are ready --- .circleci/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 51efa3345982..2ede659e6f76 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ commands: parameters: event: type: enum - enum: ["failure", "success"] + enum: ["failure", "success", "release"] condition: type: string steps: @@ -58,6 +58,10 @@ commands: [[ "<< parameters.event >>" == "failure" ]] && message=" ❌ [${workflow_name}] Job ${job} failed on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details." [[ "<< parameters.event >>" == "success" ]] && message=" ✅ [${workflow_name}] Job ${job} succeeded on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details." + [[ "<< parameters.event >>" == "release" ]] && message=" 📦 Release binaries for version **${CIRCLE_TAG}** are ready and attached as artifacts to [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}). **Please make sure the whole workflow succeeded before using them.**" + + # The release notification only makes sense on tagged commits. If the commit is untagged, just bail out. + [[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } } curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \ --request POST \ @@ -81,6 +85,13 @@ commands: event: success condition: on_success + gitter_notify_release_unless_pr: + description: "Posts a release notification to the main room on Gitter (if not running on a PR)." + steps: + - gitter_notify_unless_pr: + event: release + condition: on_success + defaults: # -------------------------------------------------------------------------- @@ -1462,6 +1473,7 @@ jobs: - store_artifacts: path: solc-bin-binaries.tar - gitter_notify_failure_unless_pr + - gitter_notify_release_unless_pr workflows: version: 2