Skip to content

STAC-0 Add docker build. #16

STAC-0 Add docker build.

STAC-0 Add docker build. #16

Workflow file for this run

name: Build and Release Cross-Platform Executables
on:
push:
tags: [ 'v*' ]
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x86_64
artifact_name: suse-observability-integrations-finder-linux-x86_64
- os: ubuntu-latest
platform: linux
arch: aarch64
artifact_name: suse-observability-integrations-finder-linux-aarch64
- os: windows-latest
platform: win
arch: x86_64
artifact_name: suse-observability-integrations-finder-win-x86_64
- os: macos-latest
platform: macos
arch: x86_64
artifact_name: suse-observability-integrations-finder-macos-x86_64
- os: macos-latest
platform: macos
arch: aarch64
artifact_name: suse-observability-integrations-finder-macos-aarch64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r build_requirements.txt
# Install system package tools based on platform
if [ "${{ matrix.platform }}" = "linux" ]; then
sudo apt-get update
sudo apt-get install -y dpkg-dev
elif [ "${{ matrix.platform }}" = "win" ]; then
# WiX tools would need to be installed here for Windows MSI creation
echo "WiX tools installation would go here for MSI creation"
elif [ "${{ matrix.platform }}" = "macos" ]; then
# pkgbuild is available by default on macOS
echo "pkgbuild is available by default on macOS"
fi
shell: bash
- name: Build executable
run: |
python build.py ${{ matrix.platform }}-${{ matrix.arch }}
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: packages/
retention-days: 30
- name: Upload build logs
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.artifact_name }}-logs
path: |
build/
*.log
retention-days: 7
test-build:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Verify builds
run: |
echo "Verifying build artifacts..."
ls -la artifacts/
echo "Build verification completed successfully!"
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Create release
run: |
# Generate release notes from commits
RELEASE_NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
--field tag_name=${{ github.ref_name }} \
--field target_commitish=${{ github.ref_name }} \
--jq .body)
# Create release using GitHub CLI
gh release create ${{ github.ref_name }} \
--title "Agent Integrations Finder ${{ github.ref_name }}" \
--notes "$RELEASE_NOTES" \
--draft=false \
--prerelease=false
# Upload artifacts to the release
for artifact in artifacts/*; do
if [ -f "$artifact" ]; then
echo "Uploading $artifact to release..."
gh release upload ${{ github.ref_name }} "$artifact"
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify release
run: |
echo "🎉 Release created for tag: ${{ github.ref_name }}"
echo "📦 Executables available for download:"
ls -la artifacts/