Skip to content

Commit

Permalink
Added helper tool for making releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbn committed Jun 5, 2024
1 parent e36f662 commit 303ac23
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .perlcriticrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = print say

[-Modules::RequireVersionVar]

[CodeLayout::RequireTidyCode]

[-Miscellanea::ProhibitUselessNoCritic]

[-ValuesAndExpressions::ProhibitVersionStrings]

[-ErrorHandling::RequireCarping]
62 changes: 62 additions & 0 deletions scripts/build.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env perl

use warnings;
use strict;
use v5.10.0;

my $version = $ARGV[0];

if (not $version) {
die 'Usage build.pl <version>';
}

say "Building Docker images for version: $version";

my @targets = qw(v0 latest);

push @targets, $version;

say 'Building Docker images for amd64 architecture';

my $counter = 0;
my $total = scalar @targets;

foreach my $target (@targets) {
say "Building $target ($counter/$total)";
system "docker build --platform linux/amd64 --tag jonasbn/github-action-spellcheck:$target .";
$counter++;
}

$counter = 0;

say "Pushing Docker images to DockerHub";
foreach my $target (@targets) {
say "Pushing $target ($counter/$total)";
system "docker push jonasbn/github-action-spellcheck:$target";
$counter++;
}

# Updating the v0 tag
say 'Deleting existing tag v0 locally';
say 'git tag --delete v0';
system 'git tag --delete v0';

say 'Deleting existing tag v0 remotely';
say 'git push --delete origin v0';
system 'git push --delete origin v0';

say 'Tagging also as v0';
say 'git tag --annotate v0 --message "Tagging v0"';
system 'git tag --annotate v0 --message "Tagging v0"';

# Pushing tags
say 'Pushing tags';
say 'git push --tags';
system 'git push --tags';

# The tagging of the version number is a part of the release process, so not need
# to tag create this tag separately
say 'Creating release on GitHub with auto generated release notes and discussion';
system "gh release create $version --discussion-category 'General' --generate-notes";

exit 0;

0 comments on commit 303ac23

Please sign in to comment.