Increment version to 1.0.11, enhance suppression handling in the anal… #11
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-Release-PYPI" | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Create virtual environment | |
| run: | | |
| python -m venv venv | |
| - name: Install dependencies in virtual environment | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install --upgrade wheel | |
| python -m pip install --upgrade pyinstaller | |
| python -m pip install --upgrade -r requirements.txt | |
| shell: pwsh | |
| - name: Build executable | |
| run: | | |
| .\venv\Scripts\Activate.ps1 | |
| pyinstaller PyRefactor.spec | |
| shell: pwsh | |
| - name: Rename executable | |
| run: | | |
| Rename-Item -Path dist/PyRefactor.exe -NewName PyRefactor-v1.0.${{ github.run_number }}.exe | |
| shell: pwsh | |
| - name: Zip the exe | |
| run: | | |
| Compress-Archive -Path "dist/PyRefactor-v1.0.${{ github.run_number }}.exe" -DestinationPath "dist/PyRefactor-v1.0.${{ github.run_number }}.zip" | |
| shell: pwsh | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: windows-build | |
| path: dist/PyRefactor-v1.0.${{ github.run_number }}.zip | |
| build-wheels: | |
| name: Build Python wheels | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install --upgrade wheel | |
| python -m pip install --upgrade build | |
| - name: Build pure Python wheel and sdist | |
| run: | | |
| python -m build | |
| - name: Store artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-dist | |
| path: dist/ | |
| create-release: | |
| needs: [build-windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Download Windows build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: windows-build | |
| path: ./build | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: ./build/PyRefactor-v1.0.${{ github.run_number }}.zip | |
| tag: v1.0.${{ github.run_number }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| allowUpdates: true | |
| removeArtifacts: true | |
| publish-pypi: | |
| name: Publish wheels to PyPI | |
| needs: build-wheels | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: python-dist | |
| path: dist | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install Twine | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install --upgrade wheel | |
| python -m pip install --upgrade twine | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PYREFACTOR }} | |
| run: | | |
| twine check dist/* | |
| twine upload dist/* |