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

Automation of github release and tag, and publish to pypi #1414

Closed
wants to merge 36 commits into from

Conversation

andrewelamb
Copy link
Contributor

@andrewelamb andrewelamb commented Apr 17, 2024

  • Fixes FDS-1613
  • Previous publish workflow renamed to publish-tag
  • Previous publish workflow now only trgiggered on non-standard tags being created (ie. 24.4.1.dev)
  • New publish workflow (publish-main) triggered on push to main
  • New publish workflow: The github tag and release are created
  • New publish workflow: Pypi release is done on push to main
  • New publish workflow: Automates the creation of the release tag using todays date and number of releases previously this month

The tag regex has been improved to:

^v[1-9][0-9]\.[0-9]+\.[0-9]\.[a-z]+$

  • The periods have been escaped as those are wild cards without doing so
  • The starting and ending special characters added
  • The \.[a-z]+ added means that
  • v24.4.1 or v24.4.1-dev won't trigger the workflow
  • v24.4.1.dev will trigger the workflow

@andrewelamb andrewelamb changed the base branch from test to develop April 18, 2024 20:25
@andrewelamb andrewelamb changed the title test automation of release version Automation of github release and tag, and publish to pypi Apr 18, 2024
@andrewelamb andrewelamb requested a review from linglp April 22, 2024 18:17
@andrewelamb
Copy link
Contributor Author

@linglp @mialy-defelice Coudl you look at the changes I just made? To solve the problems we dicussed on Wednesday, there are now two workflows.

@@ -2,7 +2,7 @@ name: Publish to PyPI
on:
push:
tags:
- 'v[1-9][0-9].[0-9]+.[0-9]+'
- 'v[1-9][0-9].[0-9]+.[0-9].[a-z]+'
branches: [main]
Copy link
Contributor

Choose a reason for hiding this comment

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

Even if we want to keep two workflows, can we clean up this workflow more? Here, this workflow will still get triggered because branches: [main]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh maybe I misunderstand how this works, but I thought this would require both the branch to be main and the tag to match. Otherwise this would have been triggered before every time we pushed to main right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went ahead and removed that line

.github/workflows/publish_tag.yml Outdated Show resolved Hide resolved
@andrewelamb andrewelamb requested a review from linglp April 26, 2024 16:54
@linglp
Copy link
Contributor

linglp commented Apr 26, 2024

@andrewelamb could you also make sure tags like v0.1.16-beta won't trigger the workflow and make a PYPI release? Because that's a tag that we want to use to build a docker image for docker deployment, and not for PYPI release.

Copy link

sonarcloud bot commented Apr 26, 2024

Quality Gate Passed Quality Gate passed

Issues
11 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@andrewelamb
Copy link
Contributor Author

andrewelamb commented Apr 26, 2024

@linglp the regex for the tag is now:

- 'v[1-9][0-9].[0-9]+.[0-9].[a-z]+'

See the description above. I tested this out here:

https://regex101.com/

Copy link
Contributor

@linglp linglp left a comment

Choose a reason for hiding this comment

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

the old workflow is still referencing override_version.py right? So if you delete override_version.py, the old workflow will fail?

@andrewelamb
Copy link
Contributor Author

@linglp Good point I'll make that fix

@linglp
Copy link
Contributor

linglp commented Apr 26, 2024

@andrewelamb additionally, I tried testing if dev tags will get tirggered by your regex, but it didn't seem to work. Github regex is different from regular regex... I found out when I was working on the docker publish workflow that even though an external tool might say that xx would work given a regex rule, it might still not work for github.

To reproduce :

  1. check out branch: develop-test-fds-1613
  2. create a tag, like v24.4.1.dev
  3. push that tag to schematic repo..

When I checked the github action tab, the workflow didn't get triggered. And then you could remove the tag both locally and remotely

@linglp
Copy link
Contributor

linglp commented May 29, 2024

@andrewelamb if you are not going to continue working on this, can this PR be closed?

@andrewelamb
Copy link
Contributor Author

@linglp Yep!

@andrewelamb
Copy link
Contributor Author

I'm going to leave the branch for now in case anyoen wants to take a crack at it in the near future.

@thomasyu888 thomasyu888 deleted the develop-fds-1613-release-automation branch November 1, 2024 17:25
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