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

chore(ci): Fix python release cycle #297

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ jobs:
- name: Test
working-directory: py/tests
run: python3 -m pytest
- name: Display structure of dist directory
run: ls -R dist
- name: Upload wheels
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v4
with:
name: wheels
# Ensure we have a different name for every artifact, by using the
# matrix components in the artifact name
name: binary-${{ matrix.type }}-${{ matrix.os }}-${{ matrix.python-version }}
Copy link
Member

Choose a reason for hiding this comment

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

I think we should at least include something that is different for tag and branch jobs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above - as I understand it, tag and branch jobs would be in different workflows, and would not have access to each others' artifacts without specifically specifying a run-id and adding a GITHUB_TOKEN to the action. Does that make sense? Am I missing something?

path: dist

release:
Expand All @@ -111,7 +115,11 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
pattern: binary-*
Copy link
Member

Choose a reason for hiding this comment

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

I think we should be more specific here to prevent downloading artifacts from the non-tag workflow run. I'm unsure what would happen to the duplicates if we do it like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding of Github Artifacts is that artifacts are shared within a workflow, but not across workflows - so that while the branch workflow and tag workflow might have artifacts with the same name, they would not be able to see each other.

From the docs:

Artifacts allow you to persist data after a job has completed, and share that data with another job in the same workflow.

See also the download-artifact docs, which discuss adding a tokens and run id to the download-artifact action to enable downloading from other runs (which we don't want to do).

# Download them all into the current directory
merge-multiple: true
- name: Display available artifacts
run: ls -R .
- name: Publish to GitHub release page
uses: softprops/action-gh-release@v2
with:
Expand Down
Loading