-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added helper tool for making releases
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |