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: Migrate CI & CD to GitHub Actions #322

Merged
merged 18 commits into from Dec 26, 2023

Conversation

LeeDongGeon1996
Copy link
Member

@LeeDongGeon1996 LeeDongGeon1996 commented Dec 23, 2023

Description

  • Migrate CI & CD to GitHub Actions

Fixes #319

Checklist

  • My code follows the existing style, code structure, and naming taxonomy
  • I have commented my code, particularly in hard-to-understand areas
  • I have performed a self-review of my own code and included any verifying manual calculations
  • I have added or updated unit tests that prove my fix is effective or that my feature works, and achieves sufficient code coverage. New and existing unit tests pass locally and in the build (below) with my changes
  • My changes generate no new warnings and running code analysis does not produce any issues
  • I have added or run the performance tests that depict optimal execution times
  • I have made corresponding changes to the documentation

@LeeDongGeon1996
Copy link
Member Author

GPT did it all...👍

@LeeDongGeon1996
Copy link
Member Author

LeeDongGeon1996 commented Dec 23, 2023

@DaveSkender Can you check Azure Pipelines webhook config? It's staying on pending status.

And are we going to keep using gitversion for deploying? or we can just tag and use tag as a package version.
I configured that it can detect semver from git tag using setuptool_scm.

I'm following this guide(Publishing package distribution releases using GitHub Actions CI/CD workflows) and it uses PyPI’s trusted publishing, Can you config for it?
Also, it will be great if we can set deployment protection rules.

@LeeDongGeon1996 LeeDongGeon1996 changed the title chore: Migrate CI to GitHub Actions chore: Migrate CI & CD to GitHub Actions Dec 23, 2023
@DaveSkender
Copy link
Member

I've added the Trusted Publisher Management for two new environments pypi and pypi-test. The former requires my review; whereas the later should be a bit more open for action.

image
image

@DaveSkender
Copy link
Member

DaveSkender commented Dec 23, 2023

Also, check for an equivalent auto-draft for the release notes after successful publish to pypi environment, same or similar to:

https://github.com/DaveSkender/Stock.Indicators/blob/6c70e30eff7e9b8bbd0e37a3fbf006e585346b34/.github/workflows/deploy-package.yml#L157-L167

Note: this may need to be configured slightly different if the timing of tagging is different. I didn't think through the scenario, so it may be okay with same implementation.

@DaveSkender
Copy link
Member

I've also removed the required check for the Azure Pipelines build, but will need to add the new CI.yml variant to the branch protection rules once everything's working well here, and probably after this is merged.

@LeeDongGeon1996
Copy link
Member Author

@DaveSkender Thanks for your work :)

The former requires my review; whereas the later should be a bit more open for action.

Yeah, that's why we need to set deployment protection rules or add review step before deployment

@LeeDongGeon1996 LeeDongGeon1996 marked this pull request as ready for review December 26, 2023 05:45
@DaveSkender
Copy link
Member

I really only have one question, how is the release tag introduced on main?

@DaveSkender DaveSkender self-requested a review December 26, 2023 06:17
Copy link
Member

@DaveSkender DaveSkender left a comment

Choose a reason for hiding this comment

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

Also, we'd need to pull out the unused SemVer stuff like gitversion.yml, how its written in contributing.md, and any other integrations that might exist in setup.py or other places where the version number is stamped.

@DaveSkender
Copy link
Member

DaveSkender commented Dec 26, 2023

How does the test.pypi.org publish get its version number?

@LeeDongGeon1996
Copy link
Member Author

You're right! I'll draft fixed contributing.md and then you correct that please.

@LeeDongGeon1996
Copy link
Member Author

LeeDongGeon1996 commented Dec 26, 2023

setuptools_scm does everything. It recognize the latest tag on repository. (AFAIK, it uses git describe)

If it's not incrementing a pre-release suffix, the publish will get rejected as a duplicate when you commit 2+ times to main before introducing an actual new Tag. If it doesn't auto-increment, you can always add a x.x.x.{ github.run_id } or something like that on it, if feasible.

(oops, sorry, edited your comment accidentally)

@LeeDongGeon1996
Copy link
Member Author

LeeDongGeon1996 commented Dec 26, 2023

Yeah as I know, setuptool_scm resolve that problem by creating unique version number, let me double check.


I've just checked that it creates unique version number by every new commit.

@DaveSkender
Copy link
Member

Let me know when you're done with contributing.md and I'll take an editorial pass on it.

@LeeDongGeon1996
Copy link
Member Author

LeeDongGeon1996 commented Dec 26, 2023

Yeah, I've already done!
You can merge after work is done.

Copy link
Member

@DaveSkender DaveSkender left a comment

Choose a reason for hiding this comment

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

All good on my end. Merge when ready.

@LeeDongGeon1996 LeeDongGeon1996 merged commit b71369a into facioquo:main Dec 26, 2023
16 checks passed
@LeeDongGeon1996 LeeDongGeon1996 deleted the chore/mig_cicd_to_gh branch December 30, 2023 09:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate build & release to GitHub Actions
2 participants