Skip to content

Commit 0cb9590

Browse files
authored
Merge pull request #12929 from ethereum/circleci-release-binaries-via-workspace
[CI] Automate preparation of release binaries for publishing (via workspace)
2 parents 25fa0d4 + dbcffb7 commit 0cb9590

File tree

2 files changed

+74
-19
lines changed

2 files changed

+74
-19
lines changed

.circleci/config.yml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ commands:
3636
parameters:
3737
event:
3838
type: enum
39-
enum: ["failure", "success"]
39+
enum: ["failure", "success", "release"]
4040
condition:
4141
type: string
4242
steps:
@@ -58,6 +58,10 @@ commands:
5858
5959
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ [${workflow_name}] Job ${job} failed on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
6060
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ [${workflow_name}] Job ${job} succeeded on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
61+
[[ "<< 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.**"
62+
63+
# The release notification only makes sense on tagged commits. If the commit is untagged, just bail out.
64+
[[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } }
6165
6266
curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \
6367
--request POST \
@@ -81,6 +85,13 @@ commands:
8185
event: success
8286
condition: on_success
8387

88+
gitter_notify_release_unless_pr:
89+
description: "Posts a release notification to the main room on Gitter (if not running on a PR)."
90+
steps:
91+
- gitter_notify_unless_pr:
92+
event: release
93+
condition: on_success
94+
8495
defaults:
8596

8697
# --------------------------------------------------------------------------
@@ -418,6 +429,13 @@ defaults:
418429
tags:
419430
only: /.*/
420431

432+
- workflow_trigger_on_releases: &workflow_trigger_on_releases
433+
filters:
434+
tags:
435+
only: /^v.*/
436+
branches:
437+
ignore: /.*/
438+
421439
- workflow_ubuntu2004: &workflow_ubuntu2004
422440
<<: *workflow_trigger_on_tags
423441
requires:
@@ -1416,6 +1434,47 @@ jobs:
14161434
path: all-bytecode-reports.zip
14171435
- gitter_notify_failure_unless_pr
14181436

1437+
c_release_binaries:
1438+
<<: *base_ubuntu2004
1439+
steps:
1440+
- checkout
1441+
- attach_workspace:
1442+
at: workspace
1443+
- run:
1444+
name: Gather and rename binaries from dependent jobs
1445+
command: |
1446+
mkdir github/
1447+
cp workspace/solc/solc github/solc-static-linux
1448+
cp workspace/build/solc/solc github/solc-macos
1449+
cp workspace/solc/Release/solc.exe github/solc-windows.exe
1450+
cp workspace/soljson.js github/soljson.js
1451+
1452+
cd github/
1453+
tar --create --file ../github-binaries.tar *
1454+
- store_artifacts:
1455+
path: github-binaries.tar
1456+
- run:
1457+
name: Rename binaries to solc-bin naming convention
1458+
command: |
1459+
full_version=$(
1460+
github/solc-static-linux --version |
1461+
sed -En 's/^Version: ([0-9.]+.*\+commit\.[0-9a-f]+(\.mod)?).*$/\1/p'
1462+
)
1463+
1464+
mkdir -p solc-bin/{linux-amd64,macosx-amd64,windows-amd64,bin}
1465+
1466+
mv github/solc-static-linux "solc-bin/linux-amd64/solc-linux-amd64-${full_version}"
1467+
mv github/solc-macos "solc-bin/macosx-amd64/solc-macosx-amd64-${full_version}"
1468+
mv github/solc-windows.exe "solc-bin/windows-amd64/solc-windows-amd64-${full_version}.exe"
1469+
mv github/soljson.js "solc-bin/bin/soljson-${full_version}.js"
1470+
1471+
cd solc-bin/
1472+
tar --create --file ../solc-bin-binaries.tar *
1473+
- store_artifacts:
1474+
path: solc-bin-binaries.tar
1475+
- gitter_notify_failure_unless_pr
1476+
- gitter_notify_release_unless_pr
1477+
14191478
workflows:
14201479
version: 2
14211480

@@ -1536,6 +1595,15 @@ workflows:
15361595
- b_bytecode_osx
15371596
- b_bytecode_ems
15381597

1598+
# Final artifacts
1599+
- c_release_binaries:
1600+
<<: *workflow_trigger_on_releases
1601+
requires:
1602+
- b_ubu_static
1603+
- b_osx
1604+
- b_win_release
1605+
- b_ems
1606+
15391607
nightly:
15401608

15411609
triggers:

ReleaseChecklist.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,16 @@
2626
- [ ] Click the `PUBLISH RELEASE` button on the release page, creating the tag.
2727
- [ ] Wait for the CI runs on the tag itself.
2828

29-
### Upload Release Artifacts
29+
### Upload Release Artifacts and Publish Binaries
3030
- [ ] Switch to the tag that archives have to be created for.
3131
- [ ] Create the ``prerelease.txt`` file: (``echo -n > prerelease.txt``).
3232
- [ ] 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``.
3333
- [ ] 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.
34-
- [ ] 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``.
35-
- [ ] 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``.
36-
- [ ] 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``.
37-
- [ ] 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``.
38-
39-
### Update [solc-bin](https://github.com/ethereum/solc-bin/)
40-
- [ ] Copy files to solc-bin:
41-
```bash
42-
VERSION=0.8.4
43-
COMMIT="c7e474f2"
44-
SOLC_BIN="/home/me/solc-bin"
45-
chmod +x solc-static-linux solc-macos
46-
cp soljson.js $SOLC_BIN/bin/soljson-v$VERSION+commit.$COMMIT.js
47-
cp solc-static-linux $SOLC_BIN/linux-amd64/solc-linux-amd64-v$VERSION+commit.$COMMIT
48-
cp solc-macos $SOLC_BIN/macosx-amd64/solc-macosx-amd64-v$VERSION+commit.$COMMIT
49-
cp solc-windows.exe $SOLC_BIN/windows-amd64/solc-windows-amd64-v$VERSION+commit.$COMMIT.exe
34+
- [ ] 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.
35+
Make sure it contains four binaries: ``solc-windows.exe``, ``solc-macos``, ``solc-static-linux`` and ``soljson.js``.
36+
- [ ] 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.
5037
- [ ] 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/``.
51-
- [ ] Create a pull request and merge.
38+
- [ ] Create a pull request in solc-bin and merge.
5239

5340
### Homebrew and MacOS
5441
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in https://github.com/Homebrew/homebrew-core/blob/master/Formula/solidity.rb

0 commit comments

Comments
 (0)