-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Should be auto-filling the release information and upload a source distro package tarball. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- Loading branch information
Showing
2 changed files
with
85 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,41 @@ | ||
#!/usr/bin/perl | ||
|
||
my $body_path = shift or die "Need a file name to store the release body"; | ||
|
||
my $ver; | ||
|
||
open IN, "configure.ac" or die; | ||
while (<IN>) { | ||
if (m/^[^\#]*AC_INIT\s*\(\s*\[\s*RASdaemon\s*\]\s*,\s*\[?(\d+[\.\d]+)/) { | ||
$ver=$1; | ||
last; | ||
} | ||
} | ||
close IN or die "can't open configure.ac"; | ||
|
||
die "Can't get version from configure.ac" if (!$ver); | ||
|
||
sub gen_version() { | ||
print "$ver\n"; | ||
|
||
open IN, "ChangeLog" or return "error opening ChangeLog"; | ||
open OUT, ">$body_path" or return "error creating $body_path"; | ||
while (<IN>) { | ||
last if (m/$ver/); | ||
} | ||
while (<IN>) { | ||
next if (m/^$/); | ||
last if (m/^\S/); | ||
|
||
my $ln = $_; | ||
$ln =~ s/^\s+\*/-/; | ||
print OUT $ln; | ||
} | ||
close OUT or return "error closing $body_path"; | ||
|
||
return ""; | ||
} | ||
|
||
my $ret = gen_version(); | ||
|
||
die($ret) if ($ret ne ""); |
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,44 @@ | ||
name: Create release on tag | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v[0-9]+*' | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Release changelog | ||
run: | | ||
.github/workflows/gen_release.pl body_file.tmp > version | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body_path: body_file.tmp | ||
draft: false | ||
prerelease: true | ||
- name: Create Source Package | ||
run: | | ||
autoreconf -vfi | ||
./configure --enable-all | ||
make dist-bzip2 | ||
mkdir artifacts | ||
mv rasdaemon-$(cat version).tar.bz2 artifacts | ||
- name: Archive package | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: rasdaemon-source-package | ||
path: artifacts/ | ||
|