Skip to content

Commit

Permalink
Script to prepare binary executables for uploading to the github rele…
Browse files Browse the repository at this point in the history
…ase page. (#6015)
  • Loading branch information
Unisay authored and effectfully committed Aug 6, 2024
1 parent 5ad7a38 commit 696f1ca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
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.
- 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

0 comments on commit 696f1ca

Please sign in to comment.