|
|
@ -16,8 +16,7 @@ use Cwd qw/abs_path cwd/;
|
|
|
|
use JSON::PP;
|
|
|
|
use JSON::PP;
|
|
|
|
use Getopt::Long;
|
|
|
|
use Getopt::Long;
|
|
|
|
|
|
|
|
|
|
|
|
my $sha256 = 0;
|
|
|
|
my @ARCHES = (qw(avr gd32));
|
|
|
|
my $size = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $platforms_template = {
|
|
|
|
my $platforms_template = {
|
|
|
|
avr => {
|
|
|
|
avr => {
|
|
|
@ -87,16 +86,17 @@ my $builds_dir = $output_dir . '/builds';
|
|
|
|
|
|
|
|
|
|
|
|
my $only_latest_platform = 0;
|
|
|
|
my $only_latest_platform = 0;
|
|
|
|
|
|
|
|
|
|
|
|
my $bundle_repo =
|
|
|
|
my $bundle_repo = 'https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio';
|
|
|
|
'https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio';
|
|
|
|
my $gd32_core_repo = 'https://github.com/keyboardio/ArduinoCore-GD32-Keyboardio';
|
|
|
|
my $boards_repo = 'https://github.com/keyboardio/boardsmanager';
|
|
|
|
my $package_repo = 'https://github.com/keyboardio/boardsmanager';
|
|
|
|
|
|
|
|
|
|
|
|
my $push_package_repo = 0;
|
|
|
|
my $push_package_repo = 0;
|
|
|
|
|
|
|
|
|
|
|
|
GetOptions(
|
|
|
|
GetOptions(
|
|
|
|
"bundle-tag=s" => \$tag,
|
|
|
|
"bundle-tag=s" => \$tag,
|
|
|
|
"kaleidoscope-tag=s" => \$kaleidoscope_tag,
|
|
|
|
"kaleidoscope-tag=s" => \$kaleidoscope_tag,
|
|
|
|
"bundle-repo=s" => \$bundle_repo,
|
|
|
|
"bundle-repo=s" => \$bundle_repo,
|
|
|
|
"output-repo=s" => \$boards_repo,
|
|
|
|
"output-repo=s" => \$package_repo,
|
|
|
|
"index-filename-slug=s" => \$index_filename_slug,
|
|
|
|
"index-filename-slug=s" => \$index_filename_slug,
|
|
|
|
"version=s" => \$version,
|
|
|
|
"version=s" => \$version,
|
|
|
|
"only-one-platform-revision" => \$only_latest_platform,
|
|
|
|
"only-one-platform-revision" => \$only_latest_platform,
|
|
|
@ -113,19 +113,19 @@ if ( $version eq '' && $tag =~ /^v(\d.*)$/ ) {
|
|
|
|
|
|
|
|
|
|
|
|
my $checkout_dir = 'kaleidoscope-checkout';
|
|
|
|
my $checkout_dir = 'kaleidoscope-checkout';
|
|
|
|
|
|
|
|
|
|
|
|
my $build_base_url = $boards_repo . "/raw/$main_branch_name/builds";
|
|
|
|
my $build_base_url = $package_repo . "/raw/$main_branch_name/builds";
|
|
|
|
$build_base_url =~ s|^ssh://git\@github.com|https://github.com|;
|
|
|
|
$build_base_url =~ s|^ssh://git\@github.com|https://github.com|;
|
|
|
|
print "Working directory: $working_dir\n";
|
|
|
|
print "Working directory: $working_dir\n";
|
|
|
|
chdir($working_dir);
|
|
|
|
chdir($working_dir);
|
|
|
|
|
|
|
|
|
|
|
|
clone_repos( $tag, $bundle_repo, $checkout_dir, $boards_repo );
|
|
|
|
clone_repos( $tag, $bundle_repo, $gd32_core_repo, $checkout_dir, $package_repo );
|
|
|
|
|
|
|
|
|
|
|
|
chdir( $working_dir . "/" . $checkout_dir );
|
|
|
|
chdir( $working_dir . "/" . $checkout_dir );
|
|
|
|
if ($only_latest_platform) {
|
|
|
|
if ($only_latest_platform) {
|
|
|
|
`rm -rf $builds_dir/*`;
|
|
|
|
`rm -rf $builds_dir/*`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach my $arch (qw(avr gd32)) {
|
|
|
|
foreach my $arch (@ARCHES) {
|
|
|
|
|
|
|
|
|
|
|
|
remove_unneeded_files($arch);
|
|
|
|
remove_unneeded_files($arch);
|
|
|
|
|
|
|
|
|
|
|
@ -166,10 +166,17 @@ sub set_plugin_versions {
|
|
|
|
sub clone_repos {
|
|
|
|
sub clone_repos {
|
|
|
|
my $tag = shift;
|
|
|
|
my $tag = shift;
|
|
|
|
my $bundle_repo = shift;
|
|
|
|
my $bundle_repo = shift;
|
|
|
|
|
|
|
|
my $gd32_repo = shift;
|
|
|
|
my $checkout_dir = shift;
|
|
|
|
my $checkout_dir = shift;
|
|
|
|
my $boards_repo = shift;
|
|
|
|
my $package_repo = shift;
|
|
|
|
|
|
|
|
my $gd32_tag = $tag;
|
|
|
|
|
|
|
|
if ($gd32_tag eq 'master') {
|
|
|
|
|
|
|
|
$gd32_tag = 'main';
|
|
|
|
|
|
|
|
}
|
|
|
|
`git clone --depth=1 --quiet --recurse-submodules --branch $tag $bundle_repo $checkout_dir`;
|
|
|
|
`git clone --depth=1 --quiet --recurse-submodules --branch $tag $bundle_repo $checkout_dir`;
|
|
|
|
`git clone $boards_repo $output_dir`;
|
|
|
|
|
|
|
|
|
|
|
|
`git clone --depth=1 --quiet --recurse-submodules --branch $gd32_tag $gd32_repo $checkout_dir/gd32`;
|
|
|
|
|
|
|
|
`git clone $package_repo $output_dir`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sub checkout_kaleidoscope {
|
|
|
|
sub checkout_kaleidoscope {
|
|
|
@ -264,10 +271,10 @@ sub build_archive {
|
|
|
|
`find $checkout_dir/$release_dir -name .git |xargs rm -rf`;
|
|
|
|
`find $checkout_dir/$release_dir -name .git |xargs rm -rf`;
|
|
|
|
`tar cjvf $filename -C $checkout_dir/ $release_dir `;
|
|
|
|
`tar cjvf $filename -C $checkout_dir/ $release_dir `;
|
|
|
|
|
|
|
|
|
|
|
|
$sha256 = `sha256sum $filename | cut -d' ' -f 1 `;
|
|
|
|
my $sha256 = `sha256sum $filename | cut -d' ' -f 1 `;
|
|
|
|
chomp($sha256);
|
|
|
|
chomp($sha256);
|
|
|
|
die "There was a problem generating the sha256" unless ($sha256);
|
|
|
|
die "There was a problem generating the sha256" unless ($sha256);
|
|
|
|
$size = -s $filename;
|
|
|
|
my $size = -s $filename;
|
|
|
|
|
|
|
|
|
|
|
|
$platforms_template->{$arch}->{'archiveFileName'} = $filename;
|
|
|
|
$platforms_template->{$arch}->{'archiveFileName'} = $filename;
|
|
|
|
$platforms_template->{$arch}->{'url'} = $build_base_url . '/' . $filename;
|
|
|
|
$platforms_template->{$arch}->{'url'} = $build_base_url . '/' . $filename;
|
|
|
|