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

feat: add publish pypi workflow #19

Merged
merged 11 commits into from
Aug 29, 2024

Conversation

Revathyvenugopal162
Copy link
Member

No description provided.

@Revathyvenugopal162 Revathyvenugopal162 changed the title Fix/release workflow feat: add publish pypi workflow Aug 21, 2024
@Revathyvenugopal162 Revathyvenugopal162 marked this pull request as ready for review August 21, 2024 19:03
Comment on lines +5 to +7
push:
branches:
- main
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
push:
branches:
- main

@Revathyvenugopal162 if this is a push to pypi only workflow, then i think we can remove the trigger on push to main

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, i adapted this from the https://github.com/pyOpenSci/pyosMeta/blob/main/.github/workflows/publish-pypi.yml, i can revert when pushing with a tag

Copy link
Member

Choose a reason for hiding this comment

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

i am sorry - you ar e right

if: github.event_name == 'release'

that ensures it only publishes to pypi on a release.

# This ensures that the publish action only runs in the main repository
# rather than forks
# Environment is encouraged so adding
environment: build
Copy link
Member

Choose a reason for hiding this comment

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

I just created this build environment on PyPI. We will need to run a release when this is merged to test it and grab the name pyos-sphinx-theme

# Only publish to real PyPI on release
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
sign-files:
Copy link
Member

Choose a reason for hiding this comment

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

@Revathyvenugopal162 this is great. Please note that I didn't set up the sigstore signing in the other repo. I'm unfamiliar with this step. We can see if it works; perhaps you know much more than I do. But I can't review it as I don't know enough!

Copy link
Member Author

Choose a reason for hiding this comment

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

As i commented above , i adapted this from https://github.com/pyOpenSci/pyosMeta/blob/main/.github/workflows/publish-pypi.yml. may be i can investigate about this a little

@@ -112,6 +119,7 @@ def setup(app):
app.add_html_theme("pyos_sphinx_theme", THEME_PATH)
app.config.html_favicon = "https://www.pyopensci.org/images/favicon.ico"
app.connect("builder-inited", update_config)
app.config.templates_path.append(str(TEMPLATE_PATH))
# app.connect("html-page-context", redirect_from_html_to_dirhtml)
Copy link
Member

Choose a reason for hiding this comment

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

Will the matomo analytics and css files be added later? or is this old code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will the matomo analytics and css files be added later? or is this old code?

no i didn't added it yet. Since i am unfamiliar with that script, i thought, we will do the first release and slowly migrate all those, addition js and css and do patch release in a regular manner if its ok for you.

Copy link
Member

Choose a reason for hiding this comment

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

@Revathyvenugopal162 i'm sorry i am so slow to reply here. yes let's move forward with a release! we can add that later.

@@ -6,3 +6,5 @@ stylesheet = styles/pyos-sphinx-theme.css

# Myst syntax extensions
myst_enable_extensions = ["colon_fence",]
footer_start = code_of_conduct, copyright
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for adding this!! This is great.

Copy link
Member

@lwasser lwasser left a comment

Choose a reason for hiding this comment

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

@Revathyvenugopal162 this looks wonderful. i left a few questions. but we could also just merge as is with the small edits that i made see how the build works if you want. then we could open another small pr in case the analytics js and css aren't included (that commented out code in the init file seemed to include those two things). Again you know a lot more than I do about these themes so I will follow your lead!

this is approved

@lwasser
Copy link
Member

lwasser commented Aug 29, 2024

I am slowing this down. Let's merge this and test out a release.

@lwasser lwasser merged commit 679ace2 into pyOpenSci:main Aug 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants