Skip to content
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

Automatically build and upload binaries on release #1743

Merged
merged 1 commit into from
Nov 1, 2020

Conversation

ichard26
Copy link
Collaborator

@ichard26 ichard26 commented Oct 5, 2020

@ichard26 ichard26 added C: cleanup Refactoring and removing dust :) C: packaging Installation and packaging of Black labels Oct 5, 2020
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, if the secret is available.

.github/workflows/upload_binary.yml Outdated Show resolved Hide resolved
.github/workflows/upload_binary.yml Show resolved Hide resolved
@ichard26 ichard26 marked this pull request as draft October 24, 2020 00:28
@ichard26 ichard26 force-pushed the self_contained_binary_workflow branch 2 times, most recently from f33134a to 31b057b Compare November 1, 2020 19:27
This commit adds a new GitHub Actions workflow that builds self-contained
binaries / executables and uploads them as release assets to the triggering
release. Publishing a release, drafting one doesn't count, will trigger this
workflow.

I personally used GitHub Actions only because it's the CI/CD platform(?)
I am familiar with. Only Windows and Linux binaries are supported since
I don't have any systems running Mac OS.

For Linux, I had originally planned to use the manylinux2010 docker image
the PyPA provides for highly compatible wheel building, but unfortunately
it wasn't feasible due to GitHub Actions and PyInstaller incompatibilities.
As a stopgap the oldest versions of Linux and Windows are used although
Windows Server 2019 isn't that old nor is Ubuntu 16.04! I guess someone
(maybe me) could work out something else if compatibility is big problem.

A few things you should know about the workflow:
 - You don't need to set the `GITHUB_TOKEN` secret as it is automatically
   provided by GitHub.
 - matrix.pathsep is used because PyInstaller configuration's format is OS
   dependent for some reason ...

Also it's worth mentioning that Black once had Travis CI and AppVeyor
configuration that did the same thing as this commit. They were committed
in mid 2018 and worked (somewhat) well. Eventually we stopped using AppVeyor
and the refactor to packages broke the Travis CI config. This commit
replaces the still existing and broken Travis CI config wholesale.

Co-authored-by: Anders Fredrik Kiær <31612826+anders-kiaer@users.noreply.github.com>

 - Anders told me that I could get the release asset upload URL directly
   from the github.event.release payload. I originally planned to use
   bruceadams/get-release to get such URL.
@ichard26 ichard26 force-pushed the self_contained_binary_workflow branch from 31b057b to 79a4cc7 Compare November 1, 2020 19:37
@ichard26 ichard26 marked this pull request as ready for review November 1, 2020 19:39
@gaborbernat
Copy link
Contributor

Any chance for a release to have again wheels for black?

@ichard26
Copy link
Collaborator Author

We plan on the next release to having wheels. Just have to hope they won't be built in a dirty directory again.

@gaborbernat
Copy link
Contributor

Any timeframe planned already for that release? 👍

@ichard26
Copy link
Collaborator Author

We're trying to target this month, but ideally within a week. No promises though, I don't make those decisions around here.

noxan pushed a commit to noxan/black that referenced this pull request Jun 6, 2021
This commit adds a new GitHub Actions workflow that builds self-contained
binaries / executables and uploads them as release assets to the triggering
release. Publishing a release, drafting one doesn't count, will trigger this
workflow.

I personally used GitHub Actions only because it's the CI/CD platform(?)
I am familiar with. Only Windows and Linux binaries are supported since
I don't have any systems running Mac OS.

For Linux, I had originally planned to use the manylinux2010 docker image
the PyPA provides for highly compatible wheel building, but unfortunately
it wasn't feasible due to GitHub Actions and PyInstaller incompatibilities.
As a stopgap the oldest versions of Linux and Windows are used although
Windows Server 2019 isn't that old nor is Ubuntu 16.04! I guess someone
(maybe me) could work out something else if compatibility is big problem.

A few things you should know about the workflow:
 - You don't need to set the `GITHUB_TOKEN` secret as it is automatically
   provided by GitHub.
 - matrix.pathsep is used because PyInstaller configuration's format is OS
   dependent for some reason ...

Also it's worth mentioning that Black once had Travis CI and AppVeyor
configuration that did the same thing as this commit. They were committed
in mid 2018 and worked (somewhat) well. Eventually we stopped using AppVeyor
and the refactor to packages broke the Travis CI config. This commit
replaces the still existing and broken Travis CI config wholesale.

Co-authored-by: Anders Fredrik Kiær <31612826+anders-kiaer@users.noreply.github.com>

 - Anders told me that I could get the release asset upload URL directly
   from the github.event.release payload. I originally planned to use
   bruceadams/get-release to get such URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: cleanup Refactoring and removing dust :) C: packaging Installation and packaging of Black
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release 20.8b1 Missing Binary
5 participants