Skip to content
Lucas Werkmeister edited this page Nov 19, 2017 · 16 revisions

Meta release process: put three dashes (---) at the very top of this file, then start copying instructions from below as you update and run them. (Try to always update them first in here and then only run code you copy from here in the terminal, not vice versa.) When the release is done, remove the section about the old release.

Release process for ceylon.ast 1.3.3 (based on ceylon.formatter (1.3.3) and ceylon.ast (1.3.2)).

Create the version-1.3. branch based on master.

git checkout -b version-1.3.3

Update the version number.

find . -name module.ceylon -exec sed -i 's 1.3.3-SNAPSHOT 1.3.3 g' {} +
git commit -a -m 'Bump version to 1.3.3'

Add the bootstrap script.

ceylon bootstrap
git add .ceylon/bootstrap ceylonb{,.bat}
git commit -m 'Add ceylon bootstrap'

Push the version- branch.

git push -u origin version-1.3.3

Choose a timestamp: date +%s, round it a bit, check with date -d @<rounded timestamp> that it’s still plausible.

Adapt the reproducible build script from the last release.

git show -s 1.3.2 | sed -n '/#!/,/exit 0/ { s/^    //; s/1\.3\.2/1.3.3/g; p; }' >| build

Edit it to update the timestamp. (Note for future releases: when you have to copy the ceylon.formatter build script instead of reusing the last ceylon.ast one, don’t forget to add nodejs to the installed packages.)

Take the Debian-Jessie-ceylondeps-1.3.3 container from the ceylon.formatter release, make sure it’s up to date and install Node in it.

sudo machinectl read-only Debian-Jessie-ceylondeps-1.3.3 false
time sudo systemd-nspawn -M Debian-Jessie-ceylondeps-1.3.3 /bin/sh -c 'apt update && apt upgrade --yes && apt install --yes nodejs'
sudo machinectl read-only Debian-Jessie-ceylondeps-1.3.3 true

Clone the container into a persistent container for the release.

sudo machinectl clone Debian-Jessie-{ceylondeps,ast}-1.3.3

Edit the build script to add an exit just before the “compare checksums” step, and to add a version- qualifier to the git checkout line, since the real tag hasn’t been created yet. (Don’t forget to push the version- branch if you haven’t done it yet.)

sed -i -e '/compare checksums/i exit' -e '/git checkout/ s/$projectVersion/version-&/' build

Run it in the container.

time sudo systemd-nspawn -M Debian-Jessie-ast-1.3.3 /bin/bash < build

Enter the container.

sudo systemd-nspawn -M Debian-Jessie-ast-1.3.3

Build the documentation.

cd /opt/ceylon.ast
ceylon doc --source-code ceylon.ast.{core,create,redhat,samples}

Create a Herd upload. Upload everything with ceylon copy.

ceylon copy --out https://modules.ceylon-lang.org/uploads/106556/repo/ --user lucaswerkmeister --pass 'XXX' --all ceylon.ast.{core,create,redhat,samples}/1.3.3

Remove the package.json files (but watch out for ceylon/ceylon-herd#271!).

Verify that the upload contains everything and has no warnings. (For ceylon.ast, there are no plugins to worry about.)

Edit the build script to change the repo URL to the upload’s public URL, and remove the exit.

sed -i '/^exit$/d; /^repo/ s|/repo/1|/uploads/106556/public/repo/|' build

Run it in an ephemeral version of the container.

time sudo systemd-nspawn --ephemeral -M Debian-Jessie-ceylondeps-1.3.3 /bin/bash < build

Rejoice that it prints four pairs of two identical checksums at the end.

Enter the persistent container again.

sudo systemd-nspawn -M Debian-Jessie-ast-1.3.3

Run the tests, using the uploaded module.

cd /opt/ceylon.ast
rm -rf modules
ceylon compile --rep https://modules.ceylon-lang.org/uploads/106556/public/repo/ test.ceylon.ast.{core,create,redhat,samples}
ceylon test --rep https://modules.ceylon-lang.org/uploads/106556/public/repo/ --rep modules test.ceylon.ast.{core,create,redhat,samples}
ceylon compile-js --rep https://modules.ceylon-lang.org/uploads/106556/public/repo/ test.ceylon.ast.{core,create}
ceylon test-js --rep https://modules.ceylon-lang.org/uploads/106556/public/repo/ --rep modules test.ceylon.ast.{core,create}
ls modules # check that the only folder inside is test, i. e., the ceylon.ast modules really came from the Herd upload

Publish the upload.

Run the tests again, this time from Herd.

rm -rf ~/.ceylon/cache
ceylon test test.ceylon.ast.{core,create,redhat,samples}
ceylon test-js test.ceylon.ast.{core,create}
ls modules # check that the only folder inside is test, i. e., the ceylon.ast modules really came from the Herd upload

Edit the build script to change the repo URL back to Herd.

sed -i 's|/uploads/[[:digit:]]\+/public/repo/|/repo/1|' build

Run it again:

time sudo systemd-nspawn --ephemeral -M Debian-Jessie-ceylondeps-1.3.3 /bin/bash < build

Rejoice that the checksums are still identical.

Remove the version- qualifier from the git checkout line in the build script.

sed -i '/git checkout/ s/version-//' build

Write and create the tag.

curl https://raw.githubusercontent.com/wiki/ceylon/ceylon.ast/Changes.md >| CHANGES
[[ $(tail -c1 CHANGES) = "" ]] || printf '\n' >> CHANGES # fix missing newline at the end
sed -i 's/-SNAPSHOT//' CHANGES
printf '\n%s' 'The `.car` files for this release have been made reproducible' 'using a fork of Debian’s `strip-nondeterminism` program.' 'The following script, on a fresh Debian Jessie GNU/Linux system,' 'should produce the exact same binary:' '' '' >> CHANGES
sed 's/^/    /' build >> CHANGES

git tag -s -F CHANGES 1.3.3

Verify one last time that the reproducible build works on a completely fresh Debian system. Since the tag hasn’t been pushed yet, we re-add the version- qualifier in sed. (We also add the apt-get update.)

time { printf 'apt-get update\n'; git show --no-patch --pretty=format:%m 1.3.3 | sed -n '/#!/,/exit 0/{s/^    //;s/checkout /checkout version-/;p}'; } | sudo systemd-nspawn --ephemeral -M Debian-Jessie-Base /bin/bash

Push the tag. Test the ultra-condensed “tweet” version of the reproducible build script:

mkdir deb &&
sudo debootstrap jessie deb &&
git show -s 1.3.3 | sed -n '/#!/,/exit 0/p' | sudo systemd-nspawn -D deb /bin/bash

Go to the GitHub release page and edit the tag to turn the message into proper Markdown (mostly: undo line breaking).

Download the release files from Herd:

cd /tmp
mkdir ast
cd ast
for mod in core create redhat samples; do wget https://modules.ceylon-lang.org/repo/1/ceylon/ast/$mod/1.3.3/ceylon.ast.$mod-1.3.3{.car,.js,-model.js,.src}{,.sha1}; done

Verify that you have 28 files:

find -type f | wc -l

Add them all to the GitHub release, in groups of 2 files. (If you upload too many at once, you get an error, and you’ll have to delete them all again one by one. Very annoying.)

Also, create a 1.3.3 folder under /keybase/public/lucaswerkmeister/ceylon.ast/ and copy the files there.

Publish the GitHub release and tweet about it.

Clone this wiki locally