-
Notifications
You must be signed in to change notification settings - Fork 105
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
Update CI to publish binary releases on git version tag #27
Conversation
Two of the new builds pull a Docker image from quay.io, (by RedHat) which has been having issues all day. (had to restart CI a few times just now to make it work) I assume that should normally be pretty stable :) |
Ubuntu Nightly, | ||
Windows Stable, | ||
Windows Nightly | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this, as it's not needed, I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out this was here for bors, see bors.toml
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it though? The jobs still have the same names. I don't think Bors checks this file or anything, it just listens for success/fail events with matching names, so I think it's fine. Unless I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks very promising (and sophisticated:) )
.github/workflows/ci.yml
Outdated
name: Publish release artifacts | ||
runs-on: ubuntu-18.04 | ||
# Builds for binary releases. | ||
# Also build on non-tag commits; it also functions as a test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an idea of how much slower this would make our general CI? I.e. does using an image affect the build times?
In my experience, the rust build still largely dominates the time. The docker image is pretty small so its pulled in no time. Running it within a docker image on Linux shouldn't effect the build time at all.. it's still running as a process on the host (no virtualization or anything) |
Looking at the reported times for each job, they are indeed very much comparable. The Windows builds take the longest, but they take about as long as the Windows builds that were already done. There are more jobs now, so potentially it can take more time if there's a queue for the pool of runners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thank you!
@grovesNL would you be interested to look at this as well? I think it would be useful. Otherwise, we'll proceed. |
.github/workflows/ci.yml
Outdated
uses: actions/upload-artifact@v2 | ||
with: | ||
path: commit-sha | ||
name: dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike wgpu-bin where we have to clone the source repo prior to building, here you can just create the commit-sha file in the final publish
job and avoid the prepare
job completely. It will allow queueing the subsequent jobs earlier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd assumed the build needed it, but make package
already does that. We can thus omit this step completely, because the GH release page already reports the commit sha :)
IMAGE: ${{ matrix.IMAGE }} | ||
RUST_TOOLCHAIN: ${{ matrix.RUST_TOOLCHAIN }} | ||
run: | | ||
CID=$(docker create -t -w /tmp/wgpu-native -v $PWD:/tmp/src:ro quay.io/pypa/$IMAGE bash -c "\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to preface all of the bash scripts with set -ex
to make sure we don't steamroll errors? Or is that by default on github actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is set -e
(-like behavior), which can be turned off with fail-fast: false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's fine then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks great to me.
The Docker idea is interesting and makes we wonder whether we should be doing something similar in gfx-portability too.
.github/workflows/ci.yml
Outdated
name: Publish release artifacts | ||
runs-on: ubuntu-18.04 | ||
# Builds for binary releases. | ||
# Also build on non-tag commits; it also functions as a test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd slightly prefer to only bother building tagged commits to avoid the potential for CI backlog, but we could start with this and see how it goes
Sounds like we are good to merge this. |
✌️ KORJin can now approve this pull request. To approve and merge a pull request, simply reply with |
(username typo) |
🔒 Permission denied Existing reviewers: click here to make grovesNL a reviewer |
cc @kvark ^ |
bah |
✌️ Korijn can now approve this pull request. To approve and merge a pull request, simply reply with |
@grovesNL sorry about that! fixed now, you should have full control here. |
No worries, it happens literally all the time! :) |
@grovesNL just to make sure we are all clear on why we're using that particular docker container:
|
LGTM. @almarklein might want to give it one last full run at your fork? |
@Korijn That was a good call. Some fixes that I had earlier made to the release job had disappeared as I prepared this new branch. Anyway:
-> https://github.com/almarklein/wgpu-native/releases/tag/v0.5.test5 |
bors r+ |
Strange, let me try |
It shows some internal server error :/ |
@almarklein any idea why build status is still pending? |
We'll need to merge this manually. That's ok. But let's also update "bors.toml" with the new task names. |
Also somewhat minor - there is a separate section in Readme describing the binary releases, which we should update according to this PR. |
Are we all set here? |
I think so. I made the release-builds only build for tags. The docker registry that the image is to be pulled from is having issues again, so I'm taking this as a sign that it's a liability. Other than that, what up with that failing MacOS build suddenly? |
quay.io is a very very common docker image registry, it's not normal for it to have issues like this.
It fails when compiling dependency
|
This is coming from gfx-backend-metal (and not RON), filed as rust-lang/rust#72467 |
This adds jobs to the Github action CI workflow, that build binaries suited for distribution. On commits that are tagged with
v...
, a matching release is made and the binaries (packed into zipfiles) are uploaded as assets.I basically took the Azure pipeline code from wgpu-bin, translated it to Github Actions, and weaved in into the existing CI. I deliberately made a new
release-build
job, so we can keep these builds separate from thetest-build
jobs.I tested this on my own fork (Github Actions Just Work on forks!), I pushed a tag, and some minutes later the releases appeared.
So to publish a release, we must bump the version in cargo.toml, and then
git tag v..
andgit push
that tag. I considered detecting the version bump and creating a tag automatically, but IMO that feels like too much automation. Open for discussion though.We have quite a lot of jobs now, some kind of duplicate. We could consider removing (some of) the
stable
test builds.