From 2d4e0b053bf069d8ed603178e42c1265a8ea0630 Mon Sep 17 00:00:00 2001 From: Dylane Bengono Date: Mon, 26 Aug 2024 13:57:53 +0100 Subject: [PATCH] chore: Update Snort build workflow to create release and upload release asset --- .github/workflows/package-snort.yml | 30 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/package-snort.yml b/.github/workflows/package-snort.yml index 179523d..1a4630a 100644 --- a/.github/workflows/package-snort.yml +++ b/.github/workflows/package-snort.yml @@ -29,15 +29,23 @@ jobs: 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 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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" \ No newline at end of file + 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