chore: Update Snort build workflow to create release and upload relea… #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Package Snort | |
on: | |
push: | |
branches: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
SNORT_VER: 3.2.2.0 # Set the Snort version here | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- 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: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.SNORT_VER }} | |
release_name: Snort v${{ env.SNORT_VER }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: /work/snort3-${SNORT_VER}/build/snort3_${SNORT_VER}_amd64.deb | |
asset_name: snort3_${SNORT_VER}_amd64.deb | |
asset_content_type: application/octet-stream |