-
Notifications
You must be signed in to change notification settings - Fork 859
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
Autobuild python wheels on release tags and create github releases with them #969
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,23 @@ jobs: | |
run: | | ||
cmake --build build --target test | ||
- name: Make release_artifacts folder | ||
run: mkdir release_artifacts | ||
|
||
- name: Add prefix to python_wheel artifact | ||
run: | | ||
for file in ./build/pypangolin-*.whl; do | ||
mv $file ./release_artifacts/${{matrix.os}}_shared_libs_${{matrix.shared_libs}}.$(basename $file); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this required? The wheel file already exists at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I experienced that the shared libs on/off wheels ended up with the same name. So renaming them to unique names is a requirement for the later download and merge artifacts step, else they will just overwrite eachother There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean that for example the wheels for sharedlibs on and sharedlibs on for ubuntu 22.04 will have the same name. The "shared libs" doesnt affect the name of the wheel. So in order to keep both the shared libs on/off versions i add the prefix containing os and sharedlibs boolean. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. You are right. But we would only upload one of the two variants, shared or static, to the release page. |
||
done | ||
- name: 'Upload release_artifacts' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "release_artifacts_${{matrix.os}}_${{matrix.shared_libs}}" | ||
path: release_artifacts/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not directly use the path You should also add a |
||
retention-days: 2 | ||
|
||
|
||
emscripten: | ||
runs-on: ubuntu-22.04 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: release | ||
|
||
on: | ||
workflow_run: | ||
workflows: [build] | ||
types: [completed] | ||
branches: [master] | ||
|
||
jobs: | ||
prepare_artifacts: | ||
# Only run the deployment if the build workflow succeeded. | ||
if: ${{ github.event.workflow_run.conclusion == 'success'}} && contains(github.ref, '/tags/v') | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Download build artifact from triggered workflow | ||
uses: dawidd6/action-download-artifact@v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you use the more official There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be easily swapped. No reason from my side |
||
with: | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: ./release_artifacts/* | ||
name_is_regexp: true | ||
path: ./release_artifacts | ||
- name: Upload release | ||
uses: softprops/action-gh-release@v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It probably does not make a huge difference, but I used
so you do not have to set the other parameters or care about the token. |
||
with: | ||
name: ${{ github.ref_name }} | ||
tag_name: ${{ github.ref_name }} | ||
files: release_artifacts/* | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generate_release_notes: true |
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.
Why are you looping over multiple wheel files? The build process should only create a single wheel file for the target platform.
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.
Cuz i am unknowing of how to rename one single file with unknown name :-)
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.
Well, if you can do
ls ./build/pypangolin-*.whl
and get a result, you can also do something likemv ./build/pypangolin-*.whl /tmp/
and will find the file there. Or do you mean something other? In any case, see my other comments, you won't need to move that wheel file around.