Skip to content

Commit

Permalink
Refactor Snort package creation process and update GitHub Actions wor…
Browse files Browse the repository at this point in the history
…kflow
  • Loading branch information
bengo237 committed Aug 30, 2024
1 parent e52204b commit 56c10d1
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/package-snort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- "*"

permissions:
contents: write

jobs:
build:
name: Build and Package Snort 3
Expand Down Expand Up @@ -41,7 +44,7 @@ jobs:
path: /work/packages/${{ matrix.arch }}

deploy:
name: Publish to GitHub Packages
name: Publish to GitHub Release
runs-on: ubuntu-latest
needs: build
env:
Expand All @@ -63,14 +66,26 @@ jobs:
name: snort3-packages-arm64
path: /work/packages/arm64

- name: Publish packages
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: Snort 3 ${{ github.ref_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload packages to GitHub Release
run: |
for ARCH in amd64 arm64; do
cd /work/packages/$ARCH
for file in *.deb; do
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file --mime-type -b $file)" \
--data-binary @$file \
"https://uploads.github.com/repos/ADORSYS-GIS/wazuh-snort/releases/assets?name=$(basename $file)"
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }}/assets?name=$(basename $file)"
done
done
done

0 comments on commit 56c10d1

Please sign in to comment.