Skip to content

Commit 2adf60d

Browse files
Merge pull request #33 from Alfredsson418/dev
2 parents d9f08ff + a0c65cc commit 2adf60d

34 files changed

+464
-425
lines changed

.github/workflows/auto-release.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Use to automaticlly create new releases
2+
3+
name: Auto Release
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
create-release:
14+
if: |
15+
github.ref_type == 'tag' &&
16+
startsWith(github.ref, 'refs/tags/v')
17+
18+
runs-on: ubuntu-latest
19+
outputs:
20+
upload_url: ${{ steps.create_release.outputs.upload_url }}
21+
22+
steps:
23+
- name: Create release
24+
id: create_release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: ${{ github.ref }}
30+
release_name: Release ${{ github.ref }}
31+
draft: false
32+
prerelease: false
33+
34+
upload-license:
35+
needs: create-release
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Clone and check out branch
40+
uses: actions/checkout@v4
41+
42+
- name: Upload License
43+
uses: actions/upload-release-asset@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
upload_url: ${{ needs.create-release.outputs.upload_url }}
48+
asset_path: ./LICENSE
49+
asset_name: LICENSE
50+
51+
fedora-build:
52+
needs: create-release
53+
54+
container: registry.fedoraproject.org/fedora-minimal:latest
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Installing git dependencies
59+
run: dnf -y install git tar
60+
61+
- name: Clone and check out branch
62+
uses: actions/checkout@v4
63+
64+
- name: Installing program dependencies
65+
run: dnf -y install gcc make jq "pkgconfig(libcjson)" "pkgconfig(libpcap)"
66+
67+
- name: Compiling
68+
run: make release
69+
70+
- name: Upload Fedora executable
71+
uses: actions/upload-release-asset@v1
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
upload_url: ${{ needs.create-release.outputs.upload_url }}
76+
asset_path: ./hawk
77+
asset_name: fedora/hawk
78+
asset_content_type: application/x-executable
79+
80+
ubuntu-build:
81+
needs: create-release
82+
83+
runs-on: ubuntu-latest
84+
85+
steps:
86+
- name: Updating OS
87+
run: sudo apt update && sudo apt upgrade -y
88+
89+
- name: Installing git dependencies
90+
run: sudo apt -y install git
91+
92+
- name: Clone and check out branch
93+
uses: actions/checkout@v4
94+
95+
- name: Installing program dependencies
96+
run: sudo apt -y install git gcc make jq libcjson-dev libpcap-dev
97+
98+
- name: Compiling with release flags
99+
run: make release
100+
101+
- name: Upload Ubuntu executable
102+
uses: actions/upload-release-asset@v1
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
with:
106+
upload_url: ${{ needs.create-release.outputs.upload_url }}
107+
asset_path: ./hawk
108+
asset_name: ubuntu/hawk
109+
asset_content_type: application/x-executable

.github/workflows/compile-test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Use to test if a program can compile before merging with dev branch
2+
# This is too prevent any changes that may result in different errors
3+
# with other branches
4+
5+
name: Compile test
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- dev
11+
- main
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
fedora-build:
17+
container: registry.fedoraproject.org/fedora-minimal:latest
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Installing git dependencies
22+
run: dnf -y install git tar
23+
24+
- name: Clone and check out branch
25+
uses: actions/checkout@v4
26+
27+
- name: Installing program dependencies
28+
run: dnf -y install gcc make jq "pkgconfig(libcjson)" "pkgconfig(libpcap)"
29+
30+
- name: Compiling with debug flags
31+
run: make debug
32+
33+
- name: Clean up
34+
run: make clean
35+
36+
- name: Compiling with release flags
37+
run: make release
38+
39+
ubuntu-build:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Fix possible broken install
44+
run: sudo apt --fix-broken install
45+
46+
- name: Updating OS
47+
run: sudo apt update && sudo apt upgrade -y
48+
49+
- name: Installing git dependencies
50+
run: sudo apt -y install git
51+
52+
- name: Clone and check out branch
53+
uses: actions/checkout@v4
54+
55+
- name: Installing program dependencies
56+
run: sudo apt -y install git gcc make jq libcjson-dev libpcap-dev
57+
58+
- name: Compiling with debug flags
59+
run: make debug
60+
61+
- name: Clean up
62+
run: make clean
63+
64+
- name: Compiling with release flags
65+
run: make release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Example:
5454
</tr>
5555
</table>
5656

57-
<h1>Want to contirbute to the project?</h1>
57+
<h1>Want to contribute to the project?</h1>
5858
<p>Read about contribution to this project over at <a href="CONTRIBUTING.md">CONTRIBUTING.md</a></p>
5959

6060
<h1>Questions</h1>

data/hooks/post-commit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
echo "-----------"
3+
echo "POST COMMIT"
4+
5+
echo "Adding tag"
6+
v="v"
7+
num=$(jq .version data/version/version.json -r)
8+
version=$v$num
9+
echo $version
10+
11+
git tag $version
12+
echo "-----------"

data/hooks/pre-commit

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
echo "-----------"
3+
echo "PRE COMMIT"
4+
5+
echo "Updating patch from:"
6+
jq .version data/version/version.json -r
7+
./data/version/increase.sh 0 0 1
8+
echo "to:"
9+
jq .version data/version/version.json -r
10+
11+
# Because he files change, we need to add it again before the commit
12+
git add data/version/version.json
13+
14+
echo "-----------"

data/motd.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

data/services/get_ports.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)