Merge pull request #111 from dseichter/dseichter/issue107 #29
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 Binaries | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build-windows-binary: | |
| runs-on: windows-latest | |
| steps: | |
| - name: 'Checkout' | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.13 | |
| - name: Create and start virtual environment | |
| run: | | |
| python3 -m venv venv | |
| venv\Scripts\activate.bat | |
| - name: Install dependencies | |
| run: pip install -r src/requirements.txt | |
| - name: Build Windows binary | |
| run: pyinstaller --onefile -w src/vatvalidation.py -n VATValidation-windows-${{ github.ref_name }}.exe --icon=icons/vatvalidation.ico | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: VATValidation-windows-${{ github.ref_name }}.exe | |
| path: dist/VATValidation-windows-${{ github.ref_name }}.exe | |
| build-windows-binary-cli: | |
| runs-on: windows-latest | |
| steps: | |
| - name: 'Checkout' | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.13 | |
| - name: Create and start virtual environment | |
| run: | | |
| python3 -m venv venv | |
| venv\Scripts\activate.bat | |
| - name: Remove PySide6 dependencies from requirements | |
| run: | | |
| type src\requirements.txt | findstr /v "PySide6" >> src\requirements_new.txt | |
| del src\requirements.txt | |
| ren src\requirements_new.txt requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r src/requirements.txt | |
| - name: Build Windows binary | |
| run: pyinstaller --onefile src/vatvalidation_cli.py -n VATValidation-cli-windows-${{ github.ref_name }}.exe | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: VATValidation-cli-windows-${{ github.ref_name }}.exe | |
| path: dist/VATValidation-cli-windows-${{ github.ref_name }}.exe | |
| test-cli-windows: | |
| runs-on: windows-latest | |
| needs: [build-windows-binary-cli] | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: VATValidation-cli-windows-${{ github.ref_name }}.exe | |
| - name: Run tests | |
| shell: cmd | |
| run: | | |
| VATValidation-cli-windows-${{ github.ref_name }}.exe --version | |
| build-linux-binary: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Checkout' | |
| uses: actions/checkout@v6 | |
| - name: Update system packages | |
| run: sudo apt-get update | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.13 | |
| - name: Create and start virtual environment | |
| run: | | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| - name: Install dependencies | |
| run: pip install -r src/requirements.txt | |
| - name: Build Linux binary | |
| run: pyinstaller --onefile src/vatvalidation.py -n VATValidation-linux-${{ github.ref_name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: VATValidation-linux-${{ github.ref_name }} | |
| path: dist/VATValidation-linux-${{ github.ref_name }} | |
| build-linux-binary-cli: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Checkout' | |
| uses: actions/checkout@v6 | |
| - name: Update system packages | |
| run: sudo apt-get update | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.13 | |
| - name: Create and start virtual environment | |
| run: | | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| - name: Remove PySide6 from requirements | |
| run: sed -i '/PySide6/d' src/requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r src/requirements.txt | |
| - name: Build Linux binary | |
| run: pyinstaller --onefile src/vatvalidation_cli.py -n VATValidation-cli-linux-${{ github.ref_name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: VATValidation-cli-linux-${{ github.ref_name }} | |
| path: dist/VATValidation-cli-linux-${{ github.ref_name }} | |
| test-cli-linux: | |
| runs-on: ubuntu-latest | |
| needs: [build-linux-binary-cli] | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: VATValidation-cli-linux-${{ github.ref_name }} | |
| - name: Run tests | |
| run: | | |
| chmod +x VATValidation-cli-linux-${{ github.ref_name }} | |
| ./VATValidation-cli-linux-${{ github.ref_name }} --version | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [build-windows-binary, build-linux-binary, test-cli-windows, test-cli-linux] | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: VATValidation-linux-${{ github.ref_name }} | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: VATValidation-cli-linux-${{ github.ref_name }} | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: VATValidation-windows-${{ github.ref_name }}.exe | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: VATValidation-cli-windows-${{ github.ref_name }}.exe | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') }} | |
| generate_release_notes: true | |
| files: | | |
| VATValidation-linux-${{ github.ref_name }} | |
| VATValidation-windows-${{ github.ref_name }}.exe | |
| VATValidation-cli-linux-${{ github.ref_name }} | |
| VATValidation-cli-windows-${{ github.ref_name }}.exe |