From c95219fdda9513c0a0d835b74e8b9ccd3710ec37 Mon Sep 17 00:00:00 2001 From: Jiashen Cao Date: Mon, 18 Sep 2023 13:39:25 -0400 Subject: [PATCH] feat: add github actions to sync and release wheel (#1154) Need to figure out a way to test it. --- .github/workflows/release.yml | 43 +++++++ .github/workflows/sync.yml | 30 +++++ .../source/dev-guide/release/pypi-account.rst | 4 +- .../dev-guide/release/release-steps-old.rst | 112 ++++++++++++++++++ .../dev-guide/release/release-steps.rst | 108 ++++------------- 5 files changed, 208 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/sync.yml create mode 100644 docs/source/dev-guide/release/release-steps-old.rst diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..e529525523 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + workflow_run: + workflows: [Sync Staging and Master] + types: + - completed + branches: + - staging + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: master + - name: Install env. + run: | + python -m venv test_evadb + source test_evadb/bin/activate + pip install --upgrade pip + pip install ".[dev]" + - name: Create pypirc. + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + cat > ~/.pypirc <`_, + + * Trigger a build for main to pull new tags. + * Go to the ``Versions`` tab, and ``Activate`` the new tag. + * Go to Admin/Advanced to set this tag as the new default version. + * In ``Overview``, make sure a build is triggered: + * For the tag ``v0.9.1`` + * For ``latest`` + +Credits: `Snorkel `_ diff --git a/docs/source/dev-guide/release/release-steps.rst b/docs/source/dev-guide/release/release-steps.rst index baf33e38b3..f1d30b04fb 100644 --- a/docs/source/dev-guide/release/release-steps.rst +++ b/docs/source/dev-guide/release/release-steps.rst @@ -1,109 +1,41 @@ -Release Steps -============= - -1. Ensure that you're in the top-level ``eva`` directory. -2. Ensure that your branch is in sync with the ``master`` branch: +.. _release_steps: -.. code-block:: bash - - $ git pull origin master -3. Add a new entry in the Changelog for the release. +Release Steps +============= -.. code-block:: python +Update Version +~~~~~~~~~~~~~~~ - ## [0.0.6] - ### [Breaking Changes] - ### [Added] - ### [Changed] - ### [Deprecated] - ### [Removed] +Update the new version number in ``evadb/version.py``. -Make sure ``CHANGELOG.md`` is up to date for the release: compare against PRs -merged since the last release. -4. Update version to, e.g. ``0.0.6`` (remove the ``+dev`` label) in ``evadb/version.py``. +Update ``master`` with ``staging`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -5. Commit these changes and create a PR: +Simply point ``master`` head to the latest commit of ``staging``. .. code-block:: bash - git checkout -b release-v0.0.6 - git add . -u - git commit -m "[RELEASE]: v0.0.6" - git push --set-upstream origin release-v0.0.6 - -6. Once the PR is approved, merge it and pull master locally. + git checkout master + git reset --hard + git push -f origin master -7. Tag the release: -.. code-block:: bash +Setup Credentials +~~~~~~~~~~~~~~~~~~ - git tag -a v0.0.6 -m "v0.0.6 release" - git push origin v0.0.6 +Please check :ref:`setup_pypi_account` about how to setup PyPi account. -8. Build the source and wheel distributions: +Setup Github token. You can obtain a personal token from Github. .. code-block:: bash - rm -rf dist build # clean old builds & distributions - python3 setup.py sdist # create a source distribution - python3 setup.py bdist_wheel # create a universal wheel - -9. Check that everything looks correct by installing the wheel locally and checking the version: - -.. code-block:: python - - python3 -m venv test_evadb # create a virtualenv for testing - source test_evadb/bin/activate # activate virtualenv - python3 -m pip install dist/evadb-0.9.1-py3-none-any.whl - python3 -c "import evadb; print(evadb.__version__)" - -10. Publish to PyPI - -.. code-block:: python - - pip install twine # if not installed - twine upload dist/* -r pypi - -11. A PR is automatically submitted (this will take a few hours) on [`conda-forge/eva-feedstock`] to update the version. - * A maintainer needs to accept and merge those changes. - -12. Create a new release on Github. - * Input the recently-created Tag Version: ``v0.0.6`` - * Copy the release notes in ``CHANGELOG.md`` to the GitHub tag. - * Attach the resulting binaries in (``dist/evadb-x.x.x.*``) to the release. - * Publish the release. - -13. Update version to, e.g. ``0.9.1+dev`` in ``evadb/version.py``. - -14. Add a new changelog entry for the unreleased version in `CHANGELOG.md`: - -.. code-block:: python - - ## [Unreleased] - ### [Breaking Changes] - ### [Added] - ### [Changed] - ### [Deprecated] - ### [Removed] + export GITHUB_KEY="..." -15. Commit these changes and create a PR: +Build Wheel and Release +~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash - git checkout -b bump-v0.9.1+dev - git add . -u - git commit -m "[BUMP]: v0.9.1+dev" - git push --set-upstream origin bump-v0.9.1+dev - -16. Add the new tag to `the EvaDB project on ReadTheDocs `_, - - * Trigger a build for main to pull new tags. - * Go to the ``Versions`` tab, and ``Activate`` the new tag. - * Go to Admin/Advanced to set this tag as the new default version. - * In ``Overview``, make sure a build is triggered: - * For the tag ``v0.9.1`` - * For ``latest`` - -Credits: `Snorkel `_ + python script/releasing/releaser.py -n minor -u