Merge pull request #3 from RyuCode-Digital-Solution/feature/add-insta… #1
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: | |
| branches: | |
| - main | |
| jobs: | |
| create_release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| steps: | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ github.run_number }} | |
| release_name: Release v${{ github.run_number }} | |
| draft: false | |
| prerelease: false | |
| build_and_upload: | |
| name: Build and Upload on ${{ matrix.os }} | |
| needs: create_release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| include: | |
| - os: ubuntu-latest | |
| asset_name: ai-commit-linux | |
| asset_path_suffix: AI-Commit | |
| - os: windows-latest | |
| asset_name: ai-commit-windows.exe | |
| asset_path_suffix: AI-Commit.exe | |
| - os: macos-latest | |
| asset_name: ai-commit-macos | |
| asset_path_suffix: AI-Commit | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.10 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build with PyInstaller | |
| run: pyinstaller --name "AI-Commit" --windowed --onefile --icon="assets/icon.ico" main.py | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create_release.outputs.upload_url }} | |
| asset_path: ./dist/${{ matrix.asset_path_suffix }} | |
| asset_name: ${{ matrix.asset_name }} | |
| asset_content_type: application/octet-stream |