Skip to content

chore: Move Snort package with correct filename during packaging #43

chore: Move Snort package with correct filename during packaging

chore: Move Snort package with correct filename during packaging #43

Workflow file for this run

name: Build and Package Snort 3
on:
push:
branches:
- "*"
jobs:
build:
name: Build and Package Snort 3
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y git dpkg-dev
- name: Build and Package Snort 3
run: |
ARCH=${{ matrix.arch }}
# Adjust the script path if necessary
bash ./scripts/snort3.sh
mkdir -p /work/packages/$ARCH
# Move the package with the correct filename
find / -name "*.deb" -exec mv {} /work/packages/$ARCH/ \;
- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: snort3-packages-${{ matrix.arch }}
path: /work/packages/${{ matrix.arch }}
deploy:
name: Publish to GitHub Packages
runs-on: ubuntu-latest
needs: build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create work directory
run: sudo mkdir -p /work && sudo chmod -R 777 /work
- name: Download amd64 packages
uses: actions/download-artifact@v3
with:
name: snort3-packages-amd64
path: /work/packages/amd64
- name: Download arm64 packages
uses: actions/download-artifact@v3
with:
name: snort3-packages-arm64
path: /work/packages/arm64
- name: Publish .deb packages to GitHub Releases
run: |
for arch in amd64 arm64; do
cd /work/packages/$arch
gh release create ${{ github.ref_name }} *.deb --repo github.com/ADORSYS-GIS/wazuh-snort --title "Snort 3 Packages for $arch" --notes "Automated release of Snort 3 packages for $arch"
cd ../../../
done