-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.38 KB
/
package-snort.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build and Package Snort
on:
push:
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set permissions for work directory
run: sudo chmod -R 777 /work
- name: Clean up work directory
run: sudo rm -rf /work/*
- name: Install dependencies and build Snort
run: |
chmod +x ./scripts/snort3.sh
./scripts/snort3.sh
- name: Create Debian package
run: |
cd /work/snort3-${SNORT_VER}/build
sudo checkinstall --pkgname=snort3 --pkgversion=${SNORT_VER} --backup=no --deldoc=yes --fstrans=no --default
- name: Upload Debian package
uses: actions/upload-artifact@v2
with:
name: snort3-deb
path: /work/snort3-${SNORT_VER}/build/snort3_${SNORT_VER}_amd64.deb
- name: Publish to GitHub Packages
run: |
curl -u ${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }} \
-H "Content-Type: $(file -b --mime-type /work/snort3-${SNORT_VER}/build/snort3_${SNORT_VER}_amd64.deb)" \
--data-binary @/work/snort3-${SNORT_VER}/build/snort3_${SNORT_VER}_amd64.deb \
"https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/latest/assets?name=snort3_${SNORT_VER}_amd64.deb"