diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78c7cad3..b96eb2fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,3 +50,15 @@ jobs: - uses: actions/checkout@v2 - run: make setup - run: make find-filename-conflicts + publish-arduino-package-on-every-commit: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v2 + - uses: webfactory/ssh-agent@v0.4.1 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_DEPLOY }} + - run: git config --global user.email "nobody@keyboard.io" + - run: git config --global user.name "Automated release publisher" + - run: make setup + - run: make build-arduino-nightly-package diff --git a/Makefile b/Makefile index cfd97924..14b212eb 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ build-arduino-nightly-package: perl bin/build-arduino-package \ --kaleidoscope-tag=master \ --version `date +%Y.%m.%d%H%M%S` \ - --index-filename-slug=kaleidoscope_nightly \ + --index-filename-slug=kaleidoscope_master \ --only-one-platform-revision \ --push \ - --output-repo=https://github.com/keyboardio/arduino-kaleidoscope-nightly + --output-repo=ssh://git@github.com/keyboardio/arduino-kaleidoscope-master diff --git a/bin/build-arduino-package b/bin/build-arduino-package index 9e030f5c..f88392b6 100644 --- a/bin/build-arduino-package +++ b/bin/build-arduino-package @@ -13,7 +13,7 @@ use warnings; use strict; use File::Temp qw/tempdir/; use Cwd qw/abs_path cwd/; -use JSON; +use JSON::PP; use Getopt::Long; my $sha256 = 0; @@ -53,10 +53,9 @@ my $checkout_dir = "Kaleidoscope-$tag-$version"; my $filename = $checkout_dir . ".tar.bz2"; my $build_base_url = $boards_repo."/master/builds/"; -$build_base_url =~ s/github.com/raw.githubusercontent.com/; +$build_base_url =~ s|ssh://git\@github.com|https://raw.githubusercontent.com|; - -my @bundle_dirs_to_remove = qw|toolchain etc doc avr/build-tools|; +my @bundle_dirs_to_remove = qw|toolchain etc doc avr/build-tools avr/bootloaders/*/lufa avr/libraries/Kaleidoscope/testing avr/libraries/Kaleidoscope/tests avr/libraries/Kaleidoscope/docs|; chdir($temp_dir); @@ -127,11 +126,11 @@ my $platform_template = { } }; -my $json = JSON->new->allow_nonref; +my $json = JSON::PP->new->allow_nonref; local $/; open( my $fh, '<', 'boardsmanager/'.$index_filename) || die "Could not open boardsmanager/$index_filename $!"; my $json_text = <$fh>; -my $data = from_json($json_text); +my $data = decode_json($json_text); if ($only_latest_platform) { @{ $data->{'packages'}->[0]->{'platforms'} } = ( $platform_template); } else {