name: Build Windows Executable on: push: tags: - 'v*' workflow_dispatch: inputs: version: description: 'Version tag' required: false default: 'latest' jobs: build-windows: runs-on: windows-latest permissions: actions: write steps: - name: Checkout code 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 GUI executable shell: pwsh run: | pyinstaller --clean --noconfirm gui.spec - name: Build CLI executable shell: pwsh run: | pyinstaller --clean --noconfirm main.spec - name: Create release package shell: pwsh run: | New-Item -ItemType Directory -Path "release" -Force | Out-Null New-Item -ItemType Directory -Path "release\data" -Force | Out-Null Copy-Item dist\searchdomain_gui.exe release\ Copy-Item dist\searchdomain_cli.exe release\ Copy-Item data\a.csv release\data\ Copy-Item data\b.csv release\data\ - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: windows-executables path: release/ - name: Create Release if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: files: release/* draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Remove old artifacts uses: c-hive/gha-remove-artifacts@v1 with: age: '3 days' # ' ', e.g. 5 days, 2 years, 90 seconds, parsed by Moment.js # Optional inputs # skip-tags: true skip-recent: 1