-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open to adding PyInstaller releases? #2947
Comments
As long as it doesn't require meaningful additional effort per release, yeah, I'm fine with this. Right now, releasing a new version to pip is just running a script. What would the new method look like? |
I assume you mean release.py which you run from your own computer? The meaningful effort per-release is either:
the one that is the least change-y codewise is option 3 the reason you need ci somewhere in there is to do the macos, windows, linux matrix which (given my assumption about "run release.py locally") you cant do on a single computer; you need I like option 2. heres more details: this is pretty much the entire code you'd need.github/workflows/release.yml name: Create release
on:
workflow_dispatch:
inputs:
pypi:
type: boolean
draft:
type: boolean
jobs:
# https://docs.pypi.org/trusted-publishers/
pypi-publish:
if: inputs.pypi
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/bikeshed
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions here
- run: idk
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
build:
strategy:
fail-fast: false
matrix:
include:
# https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#platform-tag
# python -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_"))'
- { os: ubuntu-latest, target: linux_x86_64 }
- { os: macos-latest, target: macosx_11_0_arm64 }
- { os: macos-13, target: macosx_10_9_x86_64 }
- { os: windows-latest, target: win_amd64 }
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e .
- run: pip install pyinstaller
- run: bikeshed update
- run: pyinstaller -y --name=bikeshed --collect-all=bikeshed ./bikeshed.py
- env:
target: ${{ matrix.target }}
run: |
version=$(cat bikeshed/semver.txt)
mkdir stage
mv dist/bikeshed stage/bikeshed-$target-$version
- uses: actions/upload-artifact@v4
with:
name: bikeshed-${{ matrix.target }}
path: stage
version:
outputs:
version: ${{ steps.version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: version
run: |
version=$(cat bikeshed/semver.txt)
echo "version=$version" >> "$GITHUB_OUTPUT"
gh-release-create:
needs: [build, version]
permissions:
contents: write
runs-on: ubuntu-latest
env:
version: ${{ needs.version.outputs.version }}
steps:
- uses: actions/download-artifact@v4
with:
name: bikeshed-linux_x86_64
- uses: actions/download-artifact@v4
with:
name: bikeshed-macosx_10_9_x86_64
- uses: actions/download-artifact@v4
with:
name: bikeshed-macosx_11_0_arm64
- uses: actions/download-artifact@v4
with:
name: bikeshed-win_amd64
# https://github.com/actions/upload-artifact/issues/38
- run: chmod +x bikeshed-linux_x86_64-$version/bikeshed
- run: chmod +x bikeshed-macosx_10_9_x86_64-$version/bikeshed
- run: chmod +x bikeshed-macosx_11_0_arm64-$version/bikeshed
- run: tar czf bikeshed-linux_x86_64-$version.tar.gz bikeshed-linux_x86_64-$version
- run: tar czf bikeshed-macosx_10_9_x86_64-$version.tar.gz bikeshed-macosx_10_9_x86_64-$version
- run: tar czf bikeshed-macosx_11_0_arm64-$version.tar.gz bikeshed-macosx_11_0_arm64-$version
- run: zip -r bikeshed-win_amd64-$version.zip bikeshed-win_amd64-$version
- env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release create "v$version" \
${{ (inputs.draft && '--draft') || '' }} \
--generate-notes \
bikeshed-linux_x86_64-$version.tar.gz \
bikeshed-macosx_10_9_x86_64-$version.tar.gz \
bikeshed-macosx_11_0_arm64-$version.tar.gz \
bikeshed-win_amd64-$version.zip and heres what you'd actually do to trigger a release you can make it a draft and edit the release to provide more detailed release notes or add a this is how I'm currently doing things with my bikeshed fork. its particularly nice since I don't have to open an ide or terminal to create releases -- its all done in the web interface by triggering a CI job. that can also be a downside if you prefer the terminal and local stuff. btw to clarify I'm happy doing any of the three options or whatever fits your workflow |
Excellent, that's very thoro. I'll review and do something about it. |
Why this might be good:
.zip
file with a runnablebikeshed.exe
in itWhy this might be bad:
Is this something that you'd be open to accepting contributions for? I have https://github.com/jcbhmr/bikeshed my current fork which does what I need it to do quite well. I would like to (if possible) contribute the PyInstaller stuff back to this project.
The text was updated successfully, but these errors were encountered: