Skip to content

Refactor Snort package creation process #61

Refactor Snort package creation process

Refactor Snort package creation process #61

Workflow file for this run

name: Build and Package Snort 3
on:
push:
branches:
- "*"
permissions:
contents: write
jobs:
build:
name: Build and Package Snort 3
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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 }}
bash ./scripts/snort3.sh
mkdir -p /work/packages/$ARCH
mv /work/*.deb /work/packages/$ARCH/
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: snort3-packages-${{ matrix.arch }}
path: /work/packages/${{ matrix.arch }}
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.0.0
release_name: Release v1.0.0
draft: false
prerelease: false
- name: Upload Release Asset (amd64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /work/packages/amd64/*.deb
asset_name: snort3-amd64.deb
asset_content_type: application/octet-stream
- name: Upload Release Asset (arm64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /work/packages/arm64/*.deb
asset_name: snort3-arm64.deb
asset_content_type: application/octet-stream