Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
89b1ce1
Add Fedora build workflow and clean up services
Alfredsson418 Apr 6, 2025
023abfa
Merge branch 'actions' of https://github.com/Alfredsson418/hawkeyes i…
Alfredsson418 Apr 7, 2025
9ceb5ed
Add Ubuntu CI workflow
Alfredsson418 Apr 8, 2025
73465aa
Run CI workflows on pre-release branch
Alfredsson418 Apr 8, 2025
812a7bf
Merge pull request #31 from Alfredsson418/actions
Alfredsson418 Apr 8, 2025
d6c54f5
Fixed workflow branches
Alfredsson418 Apr 8, 2025
18e3615
Merge branch 'dev' of https://github.com/Alfredsson418/hawkeyes into dev
Alfredsson418 Apr 8, 2025
0cd6887
Add sudo to package installation commands
Alfredsson418 Apr 8, 2025
3afe345
Add tar pkg and fix apt upgrade sudo permission
Alfredsson418 Apr 8, 2025
0d38d7b
Possible fix for fedora workflow
Alfredsson418 Apr 8, 2025
1a15715
Added upon workflows and possible fix for fedora workflow
Alfredsson418 Apr 8, 2025
4c4cc35
Fix for version hook
Alfredsson418 Apr 8, 2025
36131f2
Removed the need to use version.json file, it is inly used now when c…
Alfredsson418 Apr 8, 2025
7f0fb8e
Added a tag hook, auto-release workflow and command to set up hooks
Alfredsson418 Apr 8, 2025
7003a08
Added documentation about parse-services option, also more detailed h…
Alfredsson418 Apr 8, 2025
1ea3885
Fix for auto increase version number and possible fix for auto relese…
Alfredsson418 Apr 8, 2025
3324154
Added jq to install
Alfredsson418 Apr 8, 2025
3bda1bf
Possble fix for ubuntu workflow
Alfredsson418 Apr 8, 2025
a0c65cc
Merge pull request #32 from Alfredsson418/actions
Alfredsson418 Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Use to automaticlly create new releases

name: Auto Release

on:
push:
branches:
- main

workflow_dispatch:

jobs:
create-release:
if: |
github.ref_type == 'tag' &&
startsWith(github.ref, 'refs/tags/v')

runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- 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 }}
draft: false
prerelease: false

upload-license:
needs: create-release
runs-on: ubuntu-latest

steps:
- name: Clone and check out branch
uses: actions/checkout@v4

- name: Upload License
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./LICENSE
asset_name: LICENSE

fedora-build:
needs: create-release

container: registry.fedoraproject.org/fedora-minimal:latest
runs-on: ubuntu-latest

steps:
- name: Installing git dependencies
run: dnf -y install git tar

- name: Clone and check out branch
uses: actions/checkout@v4

- name: Installing program dependencies
run: dnf -y install gcc make jq "pkgconfig(libcjson)" "pkgconfig(libpcap)"

- name: Compiling
run: make release

- name: Upload Fedora executable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./hawk
asset_name: fedora/hawk
asset_content_type: application/x-executable

ubuntu-build:
needs: create-release

runs-on: ubuntu-latest

steps:
- name: Updating OS
run: sudo apt update && sudo apt upgrade -y

- name: Installing git dependencies
run: sudo apt -y install git

- name: Clone and check out branch
uses: actions/checkout@v4

- name: Installing program dependencies
run: sudo apt -y install git gcc make jq libcjson-dev libpcap-dev

- name: Compiling with release flags
run: make release

- name: Upload Ubuntu executable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./hawk
asset_name: ubuntu/hawk
asset_content_type: application/x-executable
65 changes: 65 additions & 0 deletions .github/workflows/compile-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Use to test if a program can compile before merging with dev branch
# This is too prevent any changes that may result in different errors
# with other branches

name: Compile test

on:
pull_request:
branches:
- dev
- main

workflow_dispatch:

jobs:
fedora-build:
container: registry.fedoraproject.org/fedora-minimal:latest
runs-on: ubuntu-latest

steps:
- name: Installing git dependencies
run: dnf -y install git tar

- name: Clone and check out branch
uses: actions/checkout@v4

- name: Installing program dependencies
run: dnf -y install gcc make jq "pkgconfig(libcjson)" "pkgconfig(libpcap)"

- name: Compiling with debug flags
run: make debug

- name: Clean up
run: make clean

- name: Compiling with release flags
run: make release

ubuntu-build:
runs-on: ubuntu-latest

steps:
- name: Fix possible broken install
run: sudo apt --fix-broken install

- name: Updating OS
run: sudo apt update && sudo apt upgrade -y

- name: Installing git dependencies
run: sudo apt -y install git

- name: Clone and check out branch
uses: actions/checkout@v4

- name: Installing program dependencies
run: sudo apt -y install git gcc make jq libcjson-dev libpcap-dev

- name: Compiling with debug flags
run: make debug

- name: Clean up
run: make clean

- name: Compiling with release flags
run: make release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Example:
</tr>
</table>

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

<h1>Questions</h1>
Expand Down
12 changes: 12 additions & 0 deletions data/hooks/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
echo "-----------"
echo "POST COMMIT"

echo "Adding tag"
v="v"
num=$(jq .version data/version/version.json -r)
version=$v$num
echo $version

git tag $version
echo "-----------"
14 changes: 14 additions & 0 deletions data/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
echo "-----------"
echo "PRE COMMIT"

echo "Updating patch from:"
jq .version data/version/version.json -r
./data/version/increase.sh 0 0 1
echo "to:"
jq .version data/version/version.json -r

# Because he files change, we need to add it again before the commit
git add data/version/version.json

echo "-----------"
12 changes: 0 additions & 12 deletions data/motd.txt

This file was deleted.

26 changes: 0 additions & 26 deletions data/services/get_ports.py

This file was deleted.

Loading