Prerelease v0.0.6 #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: Publish to PyPI and Docker | |
| on: | |
| release: | |
| types: [published] # Triggers when you create a GitHub Release | |
| jobs: | |
| publish-pypi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: twine upload dist/* | |
| # Build and Publish Docker Image (GHCR) | |
| publish-docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # Build Windows Installer | |
| build-windows: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| pip install -e . | |
| - name: Build with PyInstaller | |
| run: pyinstaller null.spec | |
| - name: Get version | |
| id: version | |
| run: | | |
| $version = python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])" | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| shell: pwsh | |
| - name: Build installer with Inno Setup | |
| run: | | |
| & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion="${{ steps.version.outputs.VERSION }}" installer\installer.iss | |
| shell: pwsh | |
| - name: Zip standalone build | |
| run: Compress-Archive -Path dist\NullTerminal -DestinationPath dist\NullTerminal-Standalone-${{ steps.version.outputs.VERSION }}-win64.zip | |
| shell: pwsh | |
| - name: Upload to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| dist/NullTerminal-Setup-${{ steps.version.outputs.VERSION }}.exe | |
| dist/NullTerminal-Standalone-${{ steps.version.outputs.VERSION }}-win64.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |