Commit abc55963 authored by Xavier Guimard's avatar Xavier Guimard

Edit changelog automaticaly

parent c4c63abc
Pipeline #1736 passed with stage
in 2 minutes and 29 seconds
......@@ -32,6 +32,16 @@ Before release
- Translate documentation
$ make fr-doc
With recent versions of OmegaT, launch "make fr-translation" and choose
"generate project files"
- Update changelog:
$ ./scripts/generate-changelog.pl
This update "changelog" file using GitLab issues (tags Bug, New feature,
Improvement)
- Update debian/changelog
launch just `dch -r` and force save (":w" and ot ":x")
......
#!/usr/bin/perl
#
# To use it, just insert your OW2 token in ~/.ow2-token
#
# This script downloads issues from gitlab.ow2.org and insert issues title in
# "changelog" file in a new version entry, grouped using tags: Bug,
# New feature, Improvement.
use LWP::UserAgent;
use JSON;
my $milestone = '2.0.0';
my @cat = ( 'Bug', 'Improvement', 'New feature' );
my @cat = ( 'Bug', 'New feature', 'Improvement' );
open F, "$ENV{HOME}/.ow2-token" or die "Unable to get OW2 token ($!)";
my $token = join '',<F>;
my $token = join '', <F>;
close F;
$token =~ s/\s//sg or die "No token";
my $ua = LWP::UserAgent->new();
my $result = '';
for (@cat) {
#s/ /%20/g;
my $res = $ua->get(
"https://gitlab.ow2.org/api/v4/projects/181/issues?labels=$_&milestone=$milestone&state=all&scope=all&per_page=100&private_token=$token"
);
print " * $_:\n";
$result .= " * $_:\n";
$res = JSON::from_json( $res->content );
while( my $i = pop @$res) {
print " * #$i->{iid}: $i->{title}\n";
while ( my $i = pop @$res ) {
$result .= " * #$i->{iid}: $i->{title}\n";
}
print "\n";
$result .= "\n";
}
$result =~ s/'/'"'"'/g;
`dch -c changelog -v $milestone '##CONTENT##';dch -c changelog -r --force-save-on-release '';cp changelog tmp.dch`;
open IN, 'tmp.dch';
open OUT, '>changelog';
$result =~ s/\n\n$//s;
while(<IN>) {
chomp;
s/.*##CONTENT##$/$result/;
print OUT "$_\n";
}
unlink 'tmp.dch';
  • @clement_oudot: this script is for you. It generates automatically changelog changes. You just have:

    • to set a GitLab API token in ~/.ow2-token (of course chmod 600 ~/.ow2-token)
    • to set export DEBFULLNAME=Clément Oudot and export DEBEMAIL=clem.oudot@gmail.com in your .bashrc

    Then when you'll launch ./scripts/generate-changelog.pl, it will create new changelog entry.

    I've set an entry in RELEASE file.

    Edited by Xavier Guimard
  • Don't matter with dch warnings

  • Great, tested, it works!

  • Let's release %2.0.0 😸 !

  • Soon... I plan to finish a big test phase for end june, and we can release 2.0-beta1.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment