Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to prepare binary executables for uploading to the github release page. #6015

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions RELEASE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've sneakily changed the example PR to a newer one with a slightly better description.

- 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`.
Expand Down
31 changes: 31 additions & 0 deletions scripts/prepare-bins.sh
Original file line number Diff line number Diff line change
@@ -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
Loading