Skip to content

Commit 643011f

Browse files
committed
.github: automate release process
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent e6caac7 commit 643011f

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release General
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
name: Create GitHub release
11+
runs-on: ubuntu-latest
12+
if: startsWith(github.ref, 'refs/tags/')
13+
outputs:
14+
upload_url: ${{ steps.create_release.outputs.upload_url }}
15+
release_id: ${{ steps.create_release.outputs.id }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Extract ChangeLog entry ...
19+
# Hack to extract latest entry for body_path below
20+
run: |
21+
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
22+
|head -n -1 > release.md
23+
cat release.md
24+
- name: Create release ...
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: SMCRoute v${{ github.ref }}
32+
body_path: release.md
33+
draft: false
34+
prerelease: false
35+
tarball:
36+
name: Build and upload release tarball
37+
needs: release
38+
if: startsWith(github.ref, 'refs/tags/')
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Installing dependencies ...
43+
run: |
44+
sudo modprobe ip_gre
45+
sudo apt-get -y update
46+
sudo apt-get -y install pkg-config libsystemd-dev libcap-dev tshark iptables valgrind
47+
- name: Creating Makefiles ...
48+
run: |
49+
./autogen.sh
50+
./configure --prefix= --enable-mrdisc --enable-test
51+
- name: Build release ...
52+
run: |
53+
make release
54+
ls -lF ../
55+
mkdir -p artifacts/
56+
mv ../*.tar.* artifacts/
57+
- name: Upload release artifacts ...
58+
uses: skx/github-action-publish-binaries@release-0.15
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
releaseId: ${{ needs.release.outputs.release_id }}
63+
args: artifacts/*

0 commit comments

Comments
 (0)