delphix / virtualization-sdk

Delphix vSDK.
Apache License 2.0
7 stars 25 forks source link

CP-8331 Streamline release process for automating release of python packages #445

Closed SumoSourabh closed 2 years ago

SumoSourabh commented 2 years ago

Changes

The change include adding GitHub actions to automate release process.

1. add-labels.yml - The yml is an automated Github action that will add labels to PR when they are opened or reopened. Labels will be development-release, production-release and no-release. 2. bump-version.yml - The yml is an automated Github action to update the VERSION based on patch and dev inputs. 3. pre-commit.yml - Updated the file to be invoked when PR is opened on master, develop and release branch or a Github bot creates a PR on master branch. Also, merged code lint within a single job. 4. publish-docs.yml - Updated the file by modifying the comments. No code change. 5. publish-python-packages.yml - Updated the file to release packages to PyPi also. Also, added post development and production release tasks. 6. verify-pr.yml - The yml is used to verify the PR has correct labels and expected files only. 7. build_project.sh - The shell can be used to build and test the python packages with intuitive commands. All python modules can be build and tested with one single command.

Testing

Tested workflow are present at https://github.com/SumoSourabh/virtualization-sdk/actions

Flow Testing performed

  1. Create a PR from another -> testingdevelop with no-release tag

    • This should add development-release tag
    • Update the tag to no-release
    • This should Invoke verify-pr, pre-commit changes
    • After merge, no publish should happen
  2. Create a PR from another -> testingdevelop with update to VERSION file

    • This should add development-release tag
    • Update the tag to no-release
    • after merge no release
  3. Create a PR with some changes from another -> testingdevelop

    • This should add development-release tag
    • After merge, release to testpypi should happen
    • bump up should happen
  4. Create a PR from another -> testingdevelop with VERSION update to prod

    • This should add development-release tag
    • Update to production-release tag
    • After merge, release to testpypi should happen
    • release branch and PR shpuld be created with production-release
    • bump up should happen
  5. Merge the PR created in 4

    • After the merge release to pypi should happen
    • release should be deleted

No docs should be released