diff --git a/.github/workflows/package-snort.yml b/.github/workflows/package-snort.yml index 675d711..89f9b25 100644 --- a/.github/workflows/package-snort.yml +++ b/.github/workflows/package-snort.yml @@ -40,41 +40,37 @@ jobs: name: snort3-packages-${{ matrix.arch }} path: /work/packages/${{ matrix.arch }} - release: - name: Create GitHub Release + deploy: + name: Publish to GitHub Packages runs-on: ubuntu-latest needs: build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Create work directory + run: sudo mkdir -p /work && sudo chmod -R 777 /work - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Download amd64 packages + uses: actions/download-artifact@v4 with: - tag_name: v1.0.0 - release_name: Release v1.0.0 - draft: false - prerelease: false + name: snort3-packages-amd64 + path: /work/packages/amd64 - - name: Upload Release Asset (amd64) - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Download arm64 packages + uses: actions/download-artifact@v4 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: snort3-packages-arm64 + path: /work/packages/arm64 - - 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 + - name: Publish packages + run: | + for ARCH in amd64 arm64; do + cd /work/packages/$ARCH + for file in *.deb; do + curl -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)" + done + done