#!/bin/sh # This file is a part of Julia. License is MIT: https://julialang.org/license # script to prepare binaries and source tarballs for a Julia release # aka "bucket dance" julianightlies -> julialang set -e # stop on failure cd "$[dirname $0]"/.. # run in top-level directory global shashort := $[git rev-parse --short=10 HEAD] global tag := $[git tag --points-at $shashort] if test -z $tag { echo "error: this script must be run with a tagged commit checked out" > !2 exit 1 } global version := $[cat VERSION] global majmin := $[cut -d. -f1-2 VERSION] # remove -rc# if present global majminpatch := $[cut -d- -f1 VERSION] if test $tag != "v$version" { echo "error: tagged commit does not match content of VERSION file" > !2 exit 1 } # create full-source-dist and light-source-dist tarballs from a separate # clone to ensure the directory name in them is julia-$version git clone https://github.com/JuliaLang/julia -b $tag julia-$version cd julia-$version make full-source-dist make light-source-dist mv julia-$(version)_$shashort-full.tar.gz ../julia-$version-full.tar.gz mv julia-$(version)_$shashort.tar.gz ../julia-$version.tar.gz cd .. rm -rf julia-$version # download and rename binaries, with -latest copies global julianightlies := '"https://julialangnightlies-s3.julialang.org/bin'" curl -L -o julia-$version-linux-x86_64.tar.gz \ $julianightlies/linux/x64/$majmin/julia-$majminpatch-$shashort-linux64.tar.gz cp julia-$version-linux-x86_64.tar.gz julia-$majmin-latest-linux-x86_64.tar.gz curl -L -o julia-$version-linux-i686.tar.gz \ $julianightlies/linux/x86/$majmin/julia-$majminpatch-$shashort-linux32.tar.gz cp julia-$version-linux-i686.tar.gz julia-$majmin-latest-linux-i686.tar.gz curl -L -o julia-$version-linux-arm.tar.gz \ $julianightlies/linux/arm/$majmin/julia-$majminpatch-$shashort-linuxarm.tar.gz cp julia-$version-linux-arm.tar.gz julia-$majmin-latest-linux-arm.tar.gz curl -L -o julia-$version-linux-ppc64le.tar.gz \ $julianightlies/linux/ppc64le/$majmin/julia-$majminpatch-$shashort-linuxppc64.tar.gz cp julia-$version-linux-ppc64le.tar.gz julia-$majmin-latest-linux-ppc64le.tar.gz curl -L -o "julia-$version-osx10.7 .dmg" \ $julianightlies/osx/x64/$majmin/julia-$majminpatch-$shashort-osx.dmg cp "julia-$version-osx10.7 .dmg" "julia-$majmin-latest-osx10.7 .dmg" curl -L -o julia-$version-win64.exe \ $julianightlies/winnt/x64/$majmin/julia-$majminpatch-$shashort-win64.exe cp julia-$version-win64.exe julia-$majmin-latest-win64.exe curl -L -o julia-$version-win32.exe \ $julianightlies/winnt/x86/$majmin/julia-$majminpatch-$shashort-win32.exe cp julia-$version-win32.exe julia-$majmin-latest-win32.exe if test -e codesign.sh { # code signing needs to run on windows, script is not checked in since it # hard-codes a few things. TODO: see if signtool.exe can run in wine ./codesign.sh } shasum -a 256 julia-$version* | grep -v -e sha256 -e md5 -e asc > julia-$version.sha256 md5sum julia-$version* | grep -v -e sha256 -e md5 -e asc > julia-$version.md5 gpg -u julia --armor --detach-sig julia-$version-full.tar.gz gpg -u julia --armor --detach-sig julia-$version.tar.gz gpg -u julia --armor --detach-sig julia-$version-linux-x86_64.tar.gz gpg -u julia --armor --detach-sig julia-$version-linux-i686.tar.gz gpg -u julia --armor --detach-sig julia-$version-linux-arm.tar.gz gpg -u julia --armor --detach-sig julia-$version-linux-ppc64le.tar.gz aws configure aws s3 cp --acl public-read julia-$version.sha256 s3://julialang/bin/checksums/ aws s3 cp --acl public-read julia-$version.md5 s3://julialang/bin/checksums/ for plat in [x86_64 i686 arm ppc64le] { global platshort := $[echo $plat | sed -e 's/x86_64/x64/' -e 's/i686/x86/] aws s3 cp --acl public-read julia-$version-linux-$plat.tar.gz \ s3://julialang/bin/linux/$platshort/$majmin/ aws s3 cp --acl public-read julia-$version-linux-$plat.tar.gz.asc \ s3://julialang/bin/linux/$platshort/$majmin/ aws s3 cp --acl public-read julia-$majmin-latest-linux-$plat.tar.gz \ s3://julialang/bin/linux/$platshort/$majmin/ curl -X PURGE -L "https://julialang-s3.julialang.org/bin/linux/$platshort/$majmin/julia-$majmin-latest-linux-$plat.tar.gz" } aws s3 cp --acl public-read "julia-$version-osx10.7 .dmg" \ s3://julialang/bin/osx/x64/$majmin/ aws s3 cp --acl public-read "julia-$majmin-latest-osx10.7 .dmg" \ s3://julialang/bin/osx/x64/$majmin/ curl -X PURGE -L "https://julialang-s3.julialang.org/bin/osx/x64/$majmin/julia-$majmin-latest-osx10.7 .dmg" curl -X PURGE -L "https://julialang-s3.julialang.org/bin/osx/x64/$majmin/julia-$majmin-latest-osx10.7+.dmg" aws s3 cp --acl public-read "julia-$version-win64.exe" \ s3://julialang/bin/winnt/x64/$majmin/ aws s3 cp --acl public-read "julia-$majmin-latest-win64.exe" \ s3://julialang/bin/winnt/x64/$majmin/ curl -X PURGE -L "https://julialang-s3.julialang.org/bin/winnt/x64/$majmin/julia-$majmin-latest-win64.exe" aws s3 cp --acl public-read "julia-$version-win32.exe" \ s3://julialang/bin/winnt/x86/$majmin/ aws s3 cp --acl public-read "julia-$majmin-latest-win32.exe" \ s3://julialang/bin/winnt/x86/$majmin/ curl -X PURGE -L "https://julialang-s3.julialang.org/bin/winnt/x86/$majmin/julia-$majmin-latest-win32.exe" echo "All files prepared. Attach julia-$version.tar.gz" echo "and julia-$version-full.tar.gz to github releases." (CommandList children: [ (C {(set)} {(-e)}) (C {(cd)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(dirname)} {(DQ ($ VSub_Number "$0"))})]) left_token: spids: [23 29] ) ) (/..) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:shashort) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(--short) (Lit_Other "=") (10)} {(HEAD)})] ) left_token: spids: [38 48] ) } spids: [37] ) ] spids: [37] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tag) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(tag)} {(--points-at)} {($ VSub_Name "$shashort")})] ) left_token: spids: [51 59] ) } spids: [50] ) ] spids: [50] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$tag"))} {(Lit_Other "]")}) terminator: ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ("error: this script must be run with a tagged commit checked out"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[83])] ) (C {(exit)} {(1)}) ] spids: [-1 74] ) ] spids: [-1 91] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(cat)} {(VERSION)})]) left_token: spids: [94 98] ) } spids: [93] ) ] spids: [93] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:majmin) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(cut)} {(-d.)} {(-f1-2)} {(VERSION)})]) left_token: spids: [101 109] ) } spids: [100] ) ] spids: [100] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:majminpatch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(cut)} {(-d-)} {(-f1)} {(VERSION)})]) left_token: spids: [115 123] ) } spids: [114] ) ] spids: [114] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$tag"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ (v) ($ VSub_Name "$version"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("error: tagged commit does not match content of VERSION file"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[153])] ) (C {(exit)} {(1)}) ] spids: [-1 144] ) ] spids: [-1 161] ) (C {(git)} {(clone)} {(https) (Lit_Other ":") (//github.com/JuliaLang/julia)} {(-b)} {($ VSub_Name "$tag")} {(julia-) ($ VSub_Name "$version")} ) (C {(cd)} {(julia-) ($ VSub_Name "$version")}) (C {(make)} {(full-source-dist)}) (C {(make)} {(light-source-dist)}) (C {(mv)} {(julia-) (${ VSub_Name version) (_) ($ VSub_Name "$shashort") (-full.tar.gz)} {(../julia-) ($ VSub_Name "$version") (-full.tar.gz)} ) (C {(mv)} {(julia-) (${ VSub_Name version) (_) ($ VSub_Name "$shashort") (.tar.gz)} {(../julia-) ($ VSub_Name "$version") (.tar.gz)} ) (C {(cd)} {(..)}) (C {(rm)} {(-rf)} {(julia-) ($ VSub_Name "$version")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:julianightlies) op: Equal rhs: {(DQ ("https://julialangnightlies-s3.julialang.org/bin"))} spids: [241] ) ] spids: [241] ) (C {(curl)} {(-L)} {(-o)} {(julia-) ($ VSub_Name "$version") (-linux-x86_64.tar.gz)} {($ VSub_Name "$julianightlies") (/linux/x64/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-linux64.tar.gz) } ) (C {(cp)} {(julia-) ($ VSub_Name "$version") (-linux-x86_64.tar.gz)} {(julia-) ($ VSub_Name "$majmin") (-latest-linux-x86_64.tar.gz)} ) (C {(curl)} {(-L)} {(-o)} {(julia-) ($ VSub_Name "$version") (-linux-i686.tar.gz)} {($ VSub_Name "$julianightlies") (/linux/x86/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-linux32.tar.gz) } ) (C {(cp)} {(julia-) ($ VSub_Name "$version") (-linux-i686.tar.gz)} {(julia-) ($ VSub_Name "$majmin") (-latest-linux-i686.tar.gz)} ) (C {(curl)} {(-L)} {(-o)} {(julia-) ($ VSub_Name "$version") (-linux-arm.tar.gz)} {($ VSub_Name "$julianightlies") (/linux/arm/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-linuxarm.tar.gz) } ) (C {(cp)} {(julia-) ($ VSub_Name "$version") (-linux-arm.tar.gz)} {(julia-) ($ VSub_Name "$majmin") (-latest-linux-arm.tar.gz)} ) (C {(curl)} {(-L)} {(-o)} {(julia-) ($ VSub_Name "$version") (-linux-ppc64le.tar.gz)} {($ VSub_Name "$julianightlies") (/linux/ppc64le/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-linuxppc64.tar.gz) } ) (C {(cp)} {(julia-) ($ VSub_Name "$version") (-linux-ppc64le.tar.gz)} {(julia-) ($ VSub_Name "$majmin") (-latest-linux-ppc64le.tar.gz)} ) (C {(curl)} {(-L)} {(-o)} {(DQ (julia-) ($ VSub_Name "$version") ("-osx10.7 .dmg"))} {($ VSub_Name "$julianightlies") (/osx/x64/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-osx.dmg) } ) (C {(cp)} {(DQ (julia-) ($ VSub_Name "$version") ("-osx10.7 .dmg"))} {(DQ (julia-) ($ VSub_Name "$majmin") ("-latest-osx10.7 .dmg"))} ) (C {(curl)} {(-L)} {(-o)} {(julia-) ($ VSub_Name "$version") (-win64.exe)} {($ VSub_Name "$julianightlies") (/winnt/x64/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-win64.exe) } ) (C {(cp)} {(julia-) ($ VSub_Name "$version") (-win64.exe)} {(julia-) ($ VSub_Name "$majmin") (-latest-win64.exe)} ) (C {(curl)} {(-L)} {(-o)} {(julia-) ($ VSub_Name "$version") (-win32.exe)} {($ VSub_Name "$julianightlies") (/winnt/x86/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majminpatch") (-) ($ VSub_Name "$shashort") (-win32.exe) } ) (C {(cp)} {(julia-) ($ VSub_Name "$version") (-win32.exe)} {(julia-) ($ VSub_Name "$majmin") (-latest-win32.exe)} ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {(codesign.sh)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(./codesign.sh)})] spids: [-1 481] ) ] spids: [-1 494] ) (Pipeline children: [ (C {(shasum)} {(-a)} {(256)} {(julia-) ($ VSub_Name "$version") (Lit_Other "*")}) (SimpleCommand words: [{(grep)} {(-v)} {(-e)} {(sha256)} {(-e)} {(md5)} {(-e)} {(asc)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(julia-) ($ VSub_Name "$version") (.sha256)} spids: [525] ) ] ) ] negated: False ) (Pipeline children: [ (C {(md5sum)} {(julia-) ($ VSub_Name "$version") (Lit_Other "*")}) (SimpleCommand words: [{(grep)} {(-v)} {(-e)} {(sha256)} {(-e)} {(md5)} {(-e)} {(asc)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(julia-) ($ VSub_Name "$version") (.md5)} spids: [555] ) ] ) ] negated: False ) (C {(gpg)} {(-u)} {(julia)} {(--armor)} {(--detach-sig)} {(julia-) ($ VSub_Name "$version") (-full.tar.gz)} ) (C {(gpg)} {(-u)} {(julia)} {(--armor)} {(--detach-sig)} {(julia-) ($ VSub_Name "$version") (.tar.gz)}) (C {(gpg)} {(-u)} {(julia)} {(--armor)} {(--detach-sig)} {(julia-) ($ VSub_Name "$version") (-linux-x86_64.tar.gz)} ) (C {(gpg)} {(-u)} {(julia)} {(--armor)} {(--detach-sig)} {(julia-) ($ VSub_Name "$version") (-linux-i686.tar.gz)} ) (C {(gpg)} {(-u)} {(julia)} {(--armor)} {(--detach-sig)} {(julia-) ($ VSub_Name "$version") (-linux-arm.tar.gz)} ) (C {(gpg)} {(-u)} {(julia)} {(--armor)} {(--detach-sig)} {(julia-) ($ VSub_Name "$version") (-linux-ppc64le.tar.gz)} ) (C {(aws)} {(configure)}) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(julia-) ($ VSub_Name "$version") (.sha256)} {(s3) (Lit_Other ":") (//julialang/bin/checksums/)} ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(julia-) ($ VSub_Name "$version") (.md5)} {(s3) (Lit_Other ":") (//julialang/bin/checksums/)} ) (ForEach iter_name: plat iter_words: [{(x86_64)} {(i686)} {(arm)} {(ppc64le)}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:platshort) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$plat")}) (C {(sed)} {(-e)} {(SQ )} {(-e)} {(SQ )}) ] negated: False ) ] ) left_token: spids: [706 726] ) } spids: [705] ) ] spids: [705] ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(julia-) ($ VSub_Name "$version") (-linux-) ($ VSub_Name "$plat") (.tar.gz)} {(s3) (Lit_Other ":") (//julialang/bin/linux/) ($ VSub_Name "$platshort") (/) ($ VSub_Name "$majmin") (/) } ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(julia-) ($ VSub_Name "$version") (-linux-) ($ VSub_Name "$plat") (.tar.gz.asc)} {(s3) (Lit_Other ":") (//julialang/bin/linux/) ($ VSub_Name "$platshort") (/) ($ VSub_Name "$majmin") (/) } ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(julia-) ($ VSub_Name "$majmin") (-latest-linux-) ($ VSub_Name "$plat") (.tar.gz)} {(s3) (Lit_Other ":") (//julialang/bin/linux/) ($ VSub_Name "$platshort") (/) ($ VSub_Name "$majmin") (/) } ) (C {(curl)} {(-X)} {(PURGE)} {(-L)} { (DQ ("https://julialang-s3.julialang.org/bin/linux/") ($ VSub_Name "$platshort") (/) ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majmin") (-latest-linux-) ($ VSub_Name "$plat") (.tar.gz) ) } ) ] spids: [702 830] ) spids: [692 700] ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(DQ (julia-) ($ VSub_Name "$version") ("-osx10.7 .dmg"))} {(s3) (Lit_Other ":") (//julialang/bin/osx/x64/) ($ VSub_Name "$majmin") (/)} ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(DQ (julia-) ($ VSub_Name "$majmin") ("-latest-osx10.7 .dmg"))} {(s3) (Lit_Other ":") (//julialang/bin/osx/x64/) ($ VSub_Name "$majmin") (/)} ) (C {(curl)} {(-X)} {(PURGE)} {(-L)} { (DQ ("https://julialang-s3.julialang.org/bin/osx/x64/") ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majmin") ("-latest-osx10.7 .dmg") ) } ) (C {(curl)} {(-X)} {(PURGE)} {(-L)} { (DQ ("https://julialang-s3.julialang.org/bin/osx/x64/") ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majmin") ("-latest-osx10.7+.dmg") ) } ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(DQ (julia-) ($ VSub_Name "$version") (-win64.exe))} {(s3) (Lit_Other ":") (//julialang/bin/winnt/x64/) ($ VSub_Name "$majmin") (/)} ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(DQ (julia-) ($ VSub_Name "$majmin") (-latest-win64.exe))} {(s3) (Lit_Other ":") (//julialang/bin/winnt/x64/) ($ VSub_Name "$majmin") (/)} ) (C {(curl)} {(-X)} {(PURGE)} {(-L)} { (DQ ("https://julialang-s3.julialang.org/bin/winnt/x64/") ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majmin") (-latest-win64.exe) ) } ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(DQ (julia-) ($ VSub_Name "$version") (-win32.exe))} {(s3) (Lit_Other ":") (//julialang/bin/winnt/x86/) ($ VSub_Name "$majmin") (/)} ) (C {(aws)} {(s3)} {(cp)} {(--acl)} {(public-read)} {(DQ (julia-) ($ VSub_Name "$majmin") (-latest-win32.exe))} {(s3) (Lit_Other ":") (//julialang/bin/winnt/x86/) ($ VSub_Name "$majmin") (/)} ) (C {(curl)} {(-X)} {(PURGE)} {(-L)} { (DQ ("https://julialang-s3.julialang.org/bin/winnt/x86/") ($ VSub_Name "$majmin") (/julia-) ($ VSub_Name "$majmin") (-latest-win32.exe) ) } ) (C {(echo)} {(DQ ("All files prepared. Attach julia-") ($ VSub_Name "$version") (.tar.gz))}) (C {(echo)} {(DQ ("and julia-") ($ VSub_Name "$version") ("-full.tar.gz to github releases."))}) ] )