diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..236259d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Build Release Binaries + +on: + release: + types: [created] + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Build Linux binary + run: | + pyinstaller --onefile --name trace-linux main.py + + - name: Upload Linux binary to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/trace-linux + asset_name: trace-linux + asset_content_type: application/octet-stream + + build-windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Build Windows executable + run: | + pyinstaller --onefile --name trace-windows main.py + + - name: Upload Windows executable to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/trace-windows.exe + asset_name: trace-windows.exe + asset_content_type: application/octet-stream