diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-04-17 17:59:58 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-04-17 22:10:52 -0400 |
commit | ac9003546f99250fc1b129edd804496f69c3ef1a (patch) | |
tree | c6fc3609cda0336c3779045dec7fd00773411ea3 /tools/release | |
parent | c38aeb3fbc6b45e5a71af4506c79459ce9cb2121 (diff) | |
download | rockbox-ac9003546f99250fc1b129edd804496f69c3ef1a.tar.gz rockbox-ac9003546f99250fc1b129edd804496f69c3ef1a.zip |
release: Revamp release scripts
Covers bins, voices, manuals, fonts, and source tarballs.
Only thing remaining is build-info integration
Change-Id: I3a93fd87bbeb725fc8e1b38c5787e33fa00f3f37
Diffstat (limited to 'tools/release')
-rw-r--r-- | tools/release/README | 30 | ||||
-rwxr-xr-x | tools/release/bins.pl | 77 | ||||
-rwxr-xr-x | tools/release/manuals.pl | 36 | ||||
-rwxr-xr-x | tools/release/sources.sh | 13 | ||||
-rwxr-xr-x | tools/release/voices.pl | 76 |
5 files changed, 114 insertions, 118 deletions
diff --git a/tools/release/README b/tools/release/README index 294c7ba136..19e4f0735c 100644 --- a/tools/release/README +++ b/tools/release/README | |||
@@ -5,28 +5,30 @@ | |||
5 | Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 5 | Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
6 | \/ \/ \/ \/ \/ | 6 | \/ \/ \/ \/ \/ |
7 | 7 | ||
8 | This directory contains useful scripts when creating and building | 8 | This directory the scripts used to create release artifacts. All |
9 | releases. The plan is to hopefully create a single top-level script that will | 9 | generated data is stored in an output directory (called "output"). |
10 | run everything needed to make a complete and full release and put all | 10 | |
11 | generated data into a separate output directory. | 11 | All of these scripts take two arguments; the git tag and the version string. |
12 | 12 | ||
13 | NOTE that these scripts assume that you have the necessary compilers already | 13 | NOTE that these scripts assume that you have the necessary compilers already |
14 | present in your PATH. | 14 | present in your PATH. |
15 | 15 | ||
16 | The scripts: | 16 | The scripts: |
17 | 17 | ||
18 | bins.pl Builds all the binary rockbox zip files. | 18 | bins.pl Builds all the binary rockbox zip files |
19 | 19 | manuals.pl Builds all manuals (pdf and html-zip) | |
20 | manuals.pl Builds all manuals | 20 | sources.sh Builds the source tarball |
21 | voices.pl Builds all "complete enough" voice files | ||
21 | 22 | ||
22 | voices.pl Builds all english voice files | 23 | Only "stable" targets, their manuals, and a selection of voice files are built; |
24 | these are designated in tools/builds.pm | ||
23 | 25 | ||
24 | tarball.sh Builds the source tarball | 26 | Example: |
25 | 27 | ||
28 | tools/release/sources.sh v3.15-final 3.15 | ||
26 | 29 | ||
27 | STATUS | 30 | Other notes: |
28 | 31 | ||
29 | All these scripts have a "version" variable at the top that needs editing and | 32 | * Update www/tools/dailybuild-voices.pl file to add the release target |
30 | each of this script needs to be run at the source tree root to function. Most | 33 | voice list! |
31 | of them put their generated files in a subdir called 'output' which the | 34 | * Update release target in tools/builds.pm |
32 | scripts create. | ||
diff --git a/tools/release/bins.pl b/tools/release/bins.pl index 03333a5963..2457558242 100755 --- a/tools/release/bins.pl +++ b/tools/release/bins.pl | |||
@@ -1,7 +1,5 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
2 | $version="3.15"; | 2 | require "./tools/builds.pm"; |
3 | |||
4 | require "tools/builds.pm"; | ||
5 | 3 | ||
6 | my $verbose; | 4 | my $verbose; |
7 | if($ARGV[0] eq "-v") { | 5 | if($ARGV[0] eq "-v") { |
@@ -9,53 +7,35 @@ if($ARGV[0] eq "-v") { | |||
9 | shift @ARGV; | 7 | shift @ARGV; |
10 | } | 8 | } |
11 | 9 | ||
12 | my $update; | 10 | my $tag = $ARGV[0]; |
13 | if($ARGV[0] eq "-u") { | 11 | my $version = $ARGV[1]; |
14 | $update =1; | ||
15 | shift @ARGV; | ||
16 | } | ||
17 | |||
18 | my $doonly; | ||
19 | if($ARGV[0]) { | ||
20 | $doonly = $ARGV[0]; | ||
21 | print "only build $doonly\n" if($verbose); | ||
22 | } | ||
23 | 12 | ||
24 | if($update) { | 13 | my $outdir = "output/bins"; |
25 | # svn update! | ||
26 | system("svn -q up"); | ||
27 | } | ||
28 | 14 | ||
29 | $rev = `svnversion`; | 15 | my $cpus = `nproc`; |
30 | chomp $rev; | ||
31 | print "rev $rev\n" if($verbose); | ||
32 | 16 | ||
33 | # made once for all targets | 17 | # made once for all targets |
34 | sub runone { | 18 | sub runone { |
35 | my ($dir, $confnum, $extra)=@_; | 19 | my ($dir, $confnum, $extra)=@_; |
36 | my $a; | 20 | my $a; |
37 | 21 | ||
38 | if($doonly && ($doonly ne $dir)) { | 22 | mkdir "buildb-$dir"; |
39 | return; | 23 | chdir "buildb-$dir"; |
40 | } | 24 | print "Build in buildb-$dir\n" if($verbose); |
41 | |||
42 | mkdir "build-$dir"; | ||
43 | chdir "build-$dir"; | ||
44 | print "Build in build-$dir\n" if($verbose); | ||
45 | 25 | ||
46 | # build the manual(s) | 26 | # build the manual(s) |
47 | $a = buildit($dir, $confnum, $extra); | 27 | $a = buildit($dir, $confnum, $extra); |
48 | 28 | ||
49 | chdir ".."; | 29 | chdir ".."; |
50 | 30 | ||
51 | my $o="build-$dir/rockbox.zip"; | 31 | my $o="buildb-$dir/rockbox.zip"; |
52 | my $map="build-$dir/rockbox-maps.zip"; | 32 | my $map="buildb-$dir/rockbox-maps.zip"; |
53 | my $elf="build-$dir/rockbox-elfs.zip"; | 33 | my $elf="buildb-$dir/rockbox-elfs.zip"; |
54 | if (-f $o) { | 34 | if (-f $o) { |
55 | my $newo="output/rockbox-$dir-$version.zip"; | 35 | my $newo="$outdir/rockbox-$dir-$version.zip"; |
56 | my $newmap="output/rockbox-$dir-$version-maps.zip"; | 36 | my $newmap="$outdir/rockbox-$dir-$version-maps.zip"; |
57 | my $newelf="output/rockbox-$dir-$version-elfs.zip"; | 37 | my $newelf="$outdir/rockbox-$dir-$version-elfs.zip"; |
58 | system("mkdir -p output"); | 38 | system("mkdir -p $outdir"); |
59 | system("mv $o $newo"); | 39 | system("mv $o $newo"); |
60 | print "moved $o to $newo\n" if($verbose); | 40 | print "moved $o to $newo\n" if($verbose); |
61 | system("mv $map $newmap"); | 41 | system("mv $map $newmap"); |
@@ -74,34 +54,28 @@ sub fonts { | |||
74 | my ($dir, $confnum, $newl)=@_; | 54 | my ($dir, $confnum, $newl)=@_; |
75 | my $a; | 55 | my $a; |
76 | 56 | ||
77 | if($doonly && ($doonly ne $dir)) { | 57 | mkdir "buildf-$dir"; |
78 | return; | 58 | chdir "buildf-$dir"; |
79 | } | 59 | print "Build fonts in buildf-$dir\n" if($verbose); |
80 | |||
81 | mkdir "build-$dir"; | ||
82 | chdir "build-$dir"; | ||
83 | print "Build fonts in build-$dir\n" if($verbose); | ||
84 | 60 | ||
85 | # build the fonts | 61 | # build the fonts |
86 | $a = buildfonts($dir, $confnum, $newl); | 62 | $a = buildfonts($dir, $confnum, $newl); |
87 | 63 | ||
88 | chdir ".."; | 64 | chdir ".."; |
89 | 65 | ||
90 | my $o="build-$dir/rockbox-fonts.zip"; | 66 | my $o="buildf-$dir/rockbox-fonts.zip"; |
91 | if (-f $o) { | 67 | if (-f $o) { |
92 | my $newo="output/rockbox-fonts-$version.zip"; | 68 | my $newo="$outdir/rockbox-fonts-$version.zip"; |
93 | system("mv $o $newo"); | 69 | system("mv $o $newo"); |
94 | print "moved $o to $newo\n" if($verbose); | 70 | print "moved $o to $newo\n" if($verbose); |
95 | } | 71 | } |
96 | 72 | ||
97 | print "remove all contents in build-$dir\n" if($verbose); | 73 | print "remove all contents in buildb-$dir\n" if($verbose); |
98 | system("rm -rf build-$dir"); | 74 | system("rm -rf buildf-$dir"); |
99 | 75 | ||
100 | return $a; | 76 | return $a; |
101 | }; | 77 | }; |
102 | 78 | ||
103 | |||
104 | |||
105 | sub buildit { | 79 | sub buildit { |
106 | my ($target, $confnum, $extra)=@_; | 80 | my ($target, $confnum, $extra)=@_; |
107 | 81 | ||
@@ -114,7 +88,7 @@ sub buildit { | |||
114 | `$c`; | 88 | `$c`; |
115 | 89 | ||
116 | print "Run 'make'\n" if($verbose); | 90 | print "Run 'make'\n" if($verbose); |
117 | `make VERSION=$version`; | 91 | `make -j$cpus VERSION=$version`; |
118 | 92 | ||
119 | print "Run 'make zip'\n" if($verbose); | 93 | print "Run 'make zip'\n" if($verbose); |
120 | `make zip VERSION=$version`; | 94 | `make zip VERSION=$version`; |
@@ -141,14 +115,15 @@ sub buildfonts { | |||
141 | `make fontzip`; | 115 | `make fontzip`; |
142 | } | 116 | } |
143 | 117 | ||
118 | `git checkout $tag`; | ||
119 | |||
144 | # run make in tools first to make sure they're up-to-date | 120 | # run make in tools first to make sure they're up-to-date |
145 | print "cd tools && make\n" if($verbose); | 121 | print "cd tools && make\n" if($verbose); |
146 | `(cd tools && make ) >/dev/null`; | 122 | `(cd tools && make ) >/dev/null`; |
147 | 123 | ||
148 | for my $b (&stablebuilds) { | 124 | for my $b (&usablebuilds) { |
149 | my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b; | 125 | my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b; |
150 | runone($b, $configname, $builds{$b}{ram}); | 126 | runone($b, $configname, $builds{$b}{ram}); |
151 | } | 127 | } |
152 | 128 | ||
153 | fonts("fonts", "iaudiox5"); | 129 | fonts("fonts", "iaudiox5"); |
154 | |||
diff --git a/tools/release/manuals.pl b/tools/release/manuals.pl index 923cacf747..61d298fd38 100755 --- a/tools/release/manuals.pl +++ b/tools/release/manuals.pl | |||
@@ -1,8 +1,7 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl -w |
2 | require "./tools/builds.pm"; | ||
2 | 3 | ||
3 | $version="3.15"; | 4 | require "./tools/builds.pm"; |
4 | |||
5 | require "tools/builds.pm"; | ||
6 | 5 | ||
7 | my $verbose; | 6 | my $verbose; |
8 | if($ARGV[0] eq "-v") { | 7 | if($ARGV[0] eq "-v") { |
@@ -10,21 +9,16 @@ if($ARGV[0] eq "-v") { | |||
10 | shift @ARGV; | 9 | shift @ARGV; |
11 | } | 10 | } |
12 | 11 | ||
13 | my $doonly; | 12 | my $tag = $ARGV[0]; |
14 | if($ARGV[0]) { | 13 | my $version = $ARGV[1]; |
15 | $doonly = $ARGV[0]; | 14 | |
16 | print "only build $doonly\n" if($verbose); | 15 | my $outdir = "output/manuals"; |
17 | } | ||
18 | 16 | ||
19 | # made once for all targets | 17 | # made once for all targets |
20 | sub runone { | 18 | sub runone { |
21 | my ($dir)=@_; | 19 | my ($dir)=@_; |
22 | my $a; | 20 | my $a; |
23 | 21 | ||
24 | if($doonly && ($doonly ne $dir)) { | ||
25 | return; | ||
26 | } | ||
27 | |||
28 | mkdir "buildm-$dir"; | 22 | mkdir "buildm-$dir"; |
29 | chdir "buildm-$dir"; | 23 | chdir "buildm-$dir"; |
30 | print "Build in buildm-$dir\n" if($verbose); | 24 | print "Build in buildm-$dir\n" if($verbose); |
@@ -34,16 +28,18 @@ sub runone { | |||
34 | 28 | ||
35 | chdir ".."; | 29 | chdir ".."; |
36 | 30 | ||
37 | my $o="buildm-$dir/manual/rockbox-build.pdf"; | 31 | my $o="buildm-$dir/rockbox-$dir-$version.pdf"; |
38 | if (-f $o) { | 32 | if (-f $o) { |
39 | my $newo="output/rockbox-$dir-$version.pdf"; | 33 | my $newo="$outdir/rockbox-$dir-$version.pdf"; |
40 | system("mv $o $newo"); | 34 | system("mv $o $newo"); |
41 | print "moved $o to $newo\n" if($verbose); | 35 | print "moved $o to $newo\n" if($verbose); |
36 | } else { | ||
37 | print "buildm-$dir/rockbox-$dir-$version.pdf not found\n"; | ||
42 | } | 38 | } |
43 | 39 | ||
44 | $o="buildm-$dir/rockbox-manual.zip"; | 40 | $o="buildm-$dir/rockbox-manual.zip"; |
45 | if (-f $o) { | 41 | if (-f $o) { |
46 | my $newo="output/rockbox-$dir-$version-html.zip"; | 42 | my $newo="$outdir/rockbox-$dir-$version-html.zip"; |
47 | system("mv $o $newo"); | 43 | system("mv $o $newo"); |
48 | print "moved $o to $newo\n" if($verbose); | 44 | print "moved $o to $newo\n" if($verbose); |
49 | } | 45 | } |
@@ -64,18 +60,20 @@ sub buildit { | |||
64 | print "C: $c\n" if($verbose); | 60 | print "C: $c\n" if($verbose); |
65 | `$c`; | 61 | `$c`; |
66 | 62 | ||
67 | print "Run 'make'\n" if($verbose); | 63 | print "Run 'make manual'\n" if($verbose); |
68 | `make manual VERSION=$version 2>/dev/null`; | 64 | `make manual VERSION=$version 2>/dev/null`; |
69 | 65 | ||
70 | print "Run 'make manual-zip'\n" if($verbose); | 66 | print "Run 'make manual-zip'\n" if($verbose); |
71 | `make manual-zip VERSION=$version 2>/dev/null`; | 67 | `make manual-zip VERSION=$version 2>/dev/null`; |
72 | } | 68 | } |
73 | 69 | ||
70 | `git checkout $tag`; | ||
71 | |||
74 | # run make in tools first to make sure they're up-to-date | 72 | # run make in tools first to make sure they're up-to-date |
75 | `(cd tools && make ) >/dev/null 2>&1`; | 73 | `(cd tools && make ) >/dev/null 2>&1`; |
76 | 74 | ||
77 | for my $b (&stablebuilds) { | 75 | `mkdir -p $outdir`; |
78 | next if (length($builds{$b}{configname}) > 0); # no variants | ||
79 | 76 | ||
77 | for my $b (&usablebuilds) { | ||
80 | runone($b); | 78 | runone($b); |
81 | } | 79 | } |
diff --git a/tools/release/sources.sh b/tools/release/sources.sh new file mode 100755 index 0000000000..2e9dd30bde --- /dev/null +++ b/tools/release/sources.sh | |||
@@ -0,0 +1,13 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | set -x | ||
5 | |||
6 | tag=$1 | ||
7 | version=$2 | ||
8 | |||
9 | outdir="output/source" | ||
10 | |||
11 | mkdir -p "${outdir}" | ||
12 | git archive --prefix=rockbox-$version/ -o "${outdir}/rockbox-source-${version}.tar" ${tag} | ||
13 | xz -f "${outdir}/rockbox-source-${version}.tar" | ||
diff --git a/tools/release/voices.pl b/tools/release/voices.pl index 785896e1a8..42bf533118 100755 --- a/tools/release/voices.pl +++ b/tools/release/voices.pl | |||
@@ -1,8 +1,5 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl -w |
2 | 2 | require "./tools/builds.pm"; | |
3 | $version="3.15"; | ||
4 | |||
5 | require "tools/builds.pm"; | ||
6 | 3 | ||
7 | my $verbose; | 4 | my $verbose; |
8 | if($ARGV[0] eq "-v") { | 5 | if($ARGV[0] eq "-v") { |
@@ -10,61 +7,64 @@ if($ARGV[0] eq "-v") { | |||
10 | shift @ARGV; | 7 | shift @ARGV; |
11 | } | 8 | } |
12 | 9 | ||
13 | my $doonly; | 10 | my $tag = $ARGV[0]; |
14 | if($ARGV[0]) { | 11 | my $version = $ARGV[1]; |
15 | $doonly = $ARGV[0]; | 12 | |
16 | print "only build $doonly\n" if($verbose); | 13 | my $outdir = "output/voices"; |
17 | } | ||
18 | 14 | ||
19 | # made once for all targets | 15 | # made once for all targets |
20 | sub runone { | 16 | sub runone { |
21 | my ($dir)=@_; | 17 | my ($target, $name, $lang, $engine, $voice, $engine_opts)=@_; |
22 | my $a; | 18 | my $a; |
23 | 19 | ||
24 | if($doonly && ($doonly ne $dir)) { | 20 | print "*** LANGUAGE: $lang\n"; |
25 | return; | ||
26 | } | ||
27 | 21 | ||
28 | mkdir "buildv-$dir"; | 22 | print "Build in buildv-$target-$lang\n" if($verbose); |
29 | chdir "buildv-$dir"; | ||
30 | print "Build in buildv-$dir\n" if($verbose); | ||
31 | 23 | ||
32 | # build the manual(s) | 24 | mkdir "buildv-$target-$lang"; |
33 | $a = buildit($dir); | 25 | chdir "buildv-$target-$lang"; |
34 | 26 | ||
35 | chdir ".."; | 27 | # build the voice(s) |
28 | $a = buildit($target, $lang, $engine, $voice, $engine_opts); | ||
36 | 29 | ||
37 | my $o="buildv-$dir/english.voice"; | 30 | my $o="$lang.voice"; |
38 | if (-f $o) { | 31 | if (-f $o) { |
39 | my $newo="output/$dir-$version-english.zip"; | 32 | my $newo="../$outdir/$target/voice-$target-$version-$name.zip"; |
40 | system("cp $o output/$dir-$version-english.voice"); | 33 | system("mkdir -p ../$outdir/$target"); |
34 | system("mkdir -p .rockbox/langs"); | ||
35 | system("mkdir -p output/$target"); | ||
41 | system("mkdir -p .rockbox/langs"); | 36 | system("mkdir -p .rockbox/langs"); |
42 | system("cp $o .rockbox/langs"); | 37 | system("cp $o .rockbox/langs"); |
43 | system("zip -r $newo .rockbox"); | 38 | system("zip -q -r $newo .rockbox"); |
44 | system("rm -rf .rockbox"); | 39 | system("rm -rf .rockbox"); |
40 | `chmod a+r $newo`; | ||
45 | print "moved $o to $newo\n" if($verbose); | 41 | print "moved $o to $newo\n" if($verbose); |
46 | } | 42 | } |
47 | 43 | ||
48 | print "remove all contents in buildv-$dir\n" if($verbose); | 44 | chdir ".."; |
49 | system("rm -rf buildv-$dir"); | 45 | |
46 | print "remove all contents in buildv-$target-$lang\n" if($verbose); | ||
47 | system("rm -rf buildv-$target-$lang"); | ||
50 | 48 | ||
51 | return $a; | 49 | return $a; |
52 | }; | 50 | }; |
53 | 51 | ||
54 | sub buildit { | 52 | sub buildit { |
55 | my ($model)=@_; | 53 | my ($target, $lang, $engine, $voice, $engine_opts)=@_; |
56 | 54 | ||
57 | `rm -rf * >/dev/null 2>&1`; | 55 | `rm -rf * >/dev/null 2>&1`; |
58 | 56 | ||
59 | my $c = "../tools/configure --type=av --target=$model --language=0 --tts=f --ram=0 --voice=0"; | 57 | my $c = "../tools/configure --no-ccache --type=av --target=$target --ram=-1 --language=$lang --tts=$engine --voice=$voice --ttsopts='$engine_opts'"; |
60 | 58 | ||
61 | print "C: $c\n" if($verbose); | 59 | print "C: $c\n" if($verbose); |
62 | `$c`; | 60 | system($c); |
63 | 61 | ||
64 | print "Run 'make voice'\n" if($verbose); | 62 | print "Run 'make voice'\n" if($verbose); |
65 | print `make voice VERSION=$version 2>/dev/null`; | 63 | `make voice`; |
66 | } | 64 | } |
67 | 65 | ||
66 | `git checkout $tag`; | ||
67 | |||
68 | # run make in tools first to make sure they're up-to-date | 68 | # run make in tools first to make sure they're up-to-date |
69 | `(cd tools && make ) >/dev/null 2>&1`; | 69 | `(cd tools && make ) >/dev/null 2>&1`; |
70 | 70 | ||
@@ -75,8 +75,16 @@ my $pool="$home/tmp/rockbox-voices-$version/voice-pool"; | |||
75 | `rm -f $pool/*`; | 75 | `rm -f $pool/*`; |
76 | $ENV{'POOL'}="$pool"; | 76 | $ENV{'POOL'}="$pool"; |
77 | 77 | ||
78 | for my $b (&stablebuilds) { | 78 | `mkdir -p $outdir`; |
79 | next if (length($builds{$b}{configname}) > 0); # no variants | ||
80 | 79 | ||
81 | runone($b); | 80 | for my $b (&usablebuilds) { |
82 | } | 81 | next if ($builds{$b}{voice}); # no variants |
82 | |||
83 | for my $v (&allvoices) { | ||
84 | my %voice = $voices{$v}; | ||
85 | |||
86 | # print " runone $b $v ($voices{$v}->{lang} via $voices{$v}->{defengine})\n"; | ||
87 | runone($b, $v, $voices{$v}->{lang}, $voices{$v}->{defengine}, | ||
88 | "-1", $voices{$v}->{engines}->{$voices{$v}->{defengine}}); | ||
89 | } | ||
90 | } | ||