Bump actions/download-artifact from 6 to 7 #194
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: Packaging | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - stable | |
| - docs | |
| - actions* | |
| tags: | |
| - v* | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build wheel and sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build check-manifest | |
| - name: Run check-manifest | |
| run: | | |
| python -m check_manifest | |
| - name: Build | |
| run: | | |
| python -m build | |
| - name: Upload built packages | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: packages | |
| path: dist/* | |
| if-no-files-found: error | |
| pyinstaller: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-latest, macos-13, windows-latest] | |
| name: PyInstaller • ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Install package | |
| shell: bash | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| echo "PYGELLERMANN_VERSION=$(python -c 'import pygellermann; print(pygellermann.__version__)')" >> $GITHUB_ENV | |
| - name: Install PyInstaller | |
| run: | | |
| pip install pyinstaller | |
| - name: Run PyInstaller on Windows and Linux | |
| if: runner.os != 'macOS' | |
| shell: bash | |
| run: | | |
| pyinstaller --name PyGellermann --windowed --onefile scripts/pygellermann-gui.py | |
| EXT="${{ runner.os == 'Windows' && '.exe' || '' }}" | |
| mv dist/PyGellermann$EXT dist/PyGellermann-$PYGELLERMANN_VERSION-${{ runner.os }}$EXT | |
| echo "ARTIFACT_SUFFIX=" >> $GITHUB_ENV | |
| - name: Run PyInstaller on macOS and package App Bundle to DMG | |
| if: runner.os == 'macOS' | |
| run: | | |
| pyinstaller --name PyGellermann --windowed --onedir scripts/pygellermann-gui.py | |
| brew install create-dmg | |
| curl -O https://raw.githubusercontent.com/dmgbuild/dmgbuild/main/src/dmgbuild/resources/builtin-arrow.tiff | |
| create-dmg \ | |
| --volname "PyGellermann" \ | |
| --background "builtin-arrow.tiff" \ | |
| --window-size 640 320 \ | |
| --icon-size 128 \ | |
| --icon "PyGellermann.app" 140 120 \ | |
| --hide-extension "PyGellermann.app" \ | |
| --app-drop-link 500 120 \ | |
| "dist/PyGellermann.dmg" \ | |
| "dist/PyGellermann.app/" | |
| rm -r dist/PyGellermann.app | |
| MACOS_ARCH="${{ matrix.os == 'macos-13' && '-Intel' || '-AppleSilicon' }}" | |
| mv dist/PyGellermann.dmg dist/PyGellermann-$PYGELLERMANN_VERSION-${{ runner.os }}$MACOS_ARCH.dmg | |
| echo "ARTIFACT_SUFFIX=$MACOS_ARCH" >> $GITHUB_ENV | |
| - name: Upload built executable | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: executable-${{ runner.os }}${{ env.ARTIFACT_SUFFIX }} | |
| path: dist/PyGellermann-* | |
| if-no-files-found: error | |
| create_release: | |
| name: Create release | |
| runs-on: ubuntu-latest | |
| if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | |
| needs: [build, pyinstaller] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Collect wheel, sdist, and executables | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Upload wheel, sdist, and executables to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| name: ${{ github.ref_name }} | |
| draft: true | |
| artifacts: dist/* | |
| token: ${{ secrets.GITHUB_TOKEN }} |