Update README.md #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Trigger on version tags | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| 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 build | |
| pip install -e . | |
| - name: Build executable | |
| run: | | |
| python package.py | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pubgmhud-external-api | |
| path: dist/pubgmhud-external-api | |
| retention-days: 1 | |
| build-windows: | |
| runs-on: windows-latest | |
| 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 build | |
| pip install -e . | |
| - name: Build executable | |
| run: | | |
| python package.py | |
| - name: List dist contents (debug) | |
| run: dir dist | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pubgmhud-external-api-windows | |
| path: dist/pubgmhud-external-api.exe | |
| retention-days: 1 | |
| release: | |
| needs: [build-linux, build-windows] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts (Linux) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pubgmhud-external-api | |
| path: dist/linux/ | |
| - name: Download build artifacts (Windows) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pubgmhud-external-api-windows | |
| path: dist/windows/ | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Release Asset (Linux) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./dist/linux/pubgmhud-external-api | |
| asset_name: pubgmhud-external-api-linux | |
| asset_content_type: application/octet-stream | |
| - name: Upload Release Asset (Windows) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./dist/windows/pubgmhud-external-api.exe | |
| asset_name: pubgmhud-external-api-windows.exe | |
| asset_content_type: application/octet-stream |