From deee21bf10262425f8e34fe580e5c65032a11d87 Mon Sep 17 00:00:00 2001 From: Yura Lazaryev Date: Thu, 16 May 2024 13:53:01 +0200 Subject: [PATCH] Script to prepare binary executables for uploading to the github release page. --- RELEASE.adoc | 16 ++++------------ scripts/prepare-bins.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) create mode 100755 scripts/prepare-bins.sh diff --git a/RELEASE.adoc b/RELEASE.adoc index 2bc8e778281..797060bd304 100644 --- a/RELEASE.adoc +++ b/RELEASE.adoc @@ -75,19 +75,11 @@ This updates versions and version bounds, and assembles the changelogs.open a PR - Choose as git tag `x.y.z.0` - Choose as target the git commit hash which points to the release commit - Click `Generate release notes` to automatically fill in the details of what's changed -- Create and attach pir&uplc executables to the release by running the following commands inside the repository where its HEAD is at the release commit: -- -+ -[source,bash] -------------- -nix build .#hydraJobs.x86_64-linux.musl64.ghc96.pir -cp ./result/bin/pir ./pir-x86_64-linux-ghc96 - -nix build .#hydraJobs.x86_64-linux.musl64.ghc96.uplc -cp ./result/bin/uplc ./uplc-x86_64-linux-ghc96 -------------- +- Create and attach pir&uplc executables to the release by running the following script inside the repository where its HEAD is at the release commit: `./scripts/prepare-bins.sh`. This will create `pir-x86_64-linux-ghc96` and `uplc-x86_64-linux-ghc96` executables, compress them and put in the project's root folder. Upload them to the release draft. - Click `Publish release`. -7. Open a PR in the https://github.com/IntersectMBO/cardano-haskell-packages[CHaP repository] for publishing the new version. Run `./scripts/add-from-github.sh "https://github.com/IntersectMBO/plutus" COMMIT-SHA LIST-OF-UPDATED-PACKAGES` (see https://github.com/IntersectMBO/cardano-haskell-packages#-from-github[the README on CHaP]). Example: https://github.com/IntersectMBO/cardano-haskell-packages/pull/394. +7. Open a PR in the https://github.com/IntersectMBO/cardano-haskell-packages[CHaP repository] for publishing the new version. + +If you are making PR from your own fork then don't forget to sync your fork with the upstream first. + +Run `./scripts/add-from-github.sh "https://github.com/IntersectMBO/plutus" COMMIT-SHA LIST-OF-UPDATED-PACKAGES` (see https://github.com/IntersectMBO/cardano-haskell-packages#-from-github[the README on CHaP]). Example: https://github.com/IntersectMBO/cardano-haskell-packages/pull/764. - If issues are found, create a release branch `release/x.y.z`, fix the issues on master, backport the fixes to `release/x.y.z`, tag `x.y.z.0-rc2`, and go to step 4. - Why not just fix the issues on master and tag `x.y.z.0-rc2` from master? It is desirable to minimize the amount of change between `rc1` and `rc2`, because it may reduce the tests and checks that need to be performed against `rc2`. diff --git a/scripts/prepare-bins.sh b/scripts/prepare-bins.sh new file mode 100755 index 00000000000..fada66a996f --- /dev/null +++ b/scripts/prepare-bins.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash git nix upx + +set -euo pipefail + +banner='\n +Lets prepare binaries for a release:\n + 1. Build `pir`\n + 2. Compress `pir` with `upx`\n + 3. Build `uplc`\n + 4. Compress `uplc` with `upx`\n +' + +echo -e $banner + +echo "Building pir..." + +nix build ".#hydraJobs.x86_64-linux.musl64.ghc96.pir" + +echo "Compressing pir..." + +upx -9 ./result/bin/pir -o pir-x86_64-linux-ghc96 --force-overwrite + +echo "Building uplc..." + +nix build ".#hydraJobs.x86_64-linux.musl64.ghc96.uplc" + +echo "Compressing uplc..." + +upx -9 ./result/bin/uplc -o uplc-x86_64-linux-ghc96 --force-overwrite