From 06a64bb642d12fe7a3bbfb210e4127880671e87e Mon Sep 17 00:00:00 2001 From: Jiashen Cao Date: Sun, 17 Sep 2023 18:10:39 -0400 Subject: [PATCH 1/5] add github actions to sync and release wheel --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/sync.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..cfcc131cd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create pypirc. + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + cat > ~/.pypirc < Date: Sun, 17 Sep 2023 22:35:55 -0400 Subject: [PATCH 2/5] Update sync.yml --- .github/workflows/sync.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 5225b4653..4d3c8f721 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -8,19 +8,25 @@ on: - evadb/version.py jobs: - release: + sync: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install env. + run: | + python -m venv test_evadb + source test_evadb/bin/activate + pip install --upgrade pip + pip install ".[dev]" - name: Check revision version. run: | + source test_evadb/bin/activate cmd=$(python -c "from evadb.version import _REVISION; print(_REVISION if 'dev' not in _REVISION else 'skip')") - name: Sync master and staging. run: | if [[ "$cmd" != "skip" ]]; then - git_hash=$(git rev-parse --short "${{ github.sha }}") + git pull git checkout master - git reset --hard $git_hash + git reset --hard ${{ github.sha }} git push -f origin master fi - From 4bcaf3fbe7638125c2198b319e01d54442f8eb4a Mon Sep 17 00:00:00 2001 From: Jiashen Cao Date: Sun, 17 Sep 2023 22:36:53 -0400 Subject: [PATCH 3/5] Update release.yml --- .github/workflows/release.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfcc131cd..e52952552 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,26 @@ name: Release on: - push: - branches: - - master + 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 }} @@ -19,7 +30,6 @@ jobs: [distutils] index-servers = pypi - [pypi] repository = https://upload.pypi.org/legacy/ username = ${PYPI_USERNAME} @@ -29,4 +39,5 @@ jobs: env: GITHUB_KEY: ${{ github.token }} run: | + source test_evadb/bin/activate python script/releasing/releaser.py -n minor -u From a987090b244af261ac90f2ac43f5488189f385f0 Mon Sep 17 00:00:00 2001 From: Jiashen Cao Date: Sun, 17 Sep 2023 23:01:18 -0400 Subject: [PATCH 4/5] Update sync.yml --- .github/workflows/sync.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 4d3c8f721..1253843c4 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -18,12 +18,10 @@ jobs: source test_evadb/bin/activate pip install --upgrade pip pip install ".[dev]" - - name: Check revision version. + - name: Check version and sync. run: | source test_evadb/bin/activate cmd=$(python -c "from evadb.version import _REVISION; print(_REVISION if 'dev' not in _REVISION else 'skip')") - - name: Sync master and staging. - run: | if [[ "$cmd" != "skip" ]]; then git pull git checkout master From bc650ae783b26b25c0dabcae1741c9b35ac70498 Mon Sep 17 00:00:00 2001 From: Jiashen Cao Date: Mon, 18 Sep 2023 10:21:20 -0400 Subject: [PATCH 5/5] update release doc --- .../source/dev-guide/release/pypi-account.rst | 4 +- .../dev-guide/release/release-steps-old.rst | 112 ++++++++++++++++++ .../dev-guide/release/release-steps.rst | 108 ++++------------- 3 files changed, 135 insertions(+), 89 deletions(-) create mode 100644 docs/source/dev-guide/release/release-steps-old.rst diff --git a/docs/source/dev-guide/release/pypi-account.rst b/docs/source/dev-guide/release/pypi-account.rst index c28e94c91..8ea35e375 100644 --- a/docs/source/dev-guide/release/pypi-account.rst +++ b/docs/source/dev-guide/release/pypi-account.rst @@ -1,3 +1,5 @@ +.. _setup_pypi_account: + Setup PyPI Account ================== @@ -15,4 +17,4 @@ Create a .pypirc in your home directory. It should look like this: username=YOUR_USERNAME password=YOUR_PASSWORD -Then run ``chmod 600 ./.pypirc`` so that only you can read/write the file. +Then run ``chmod 600 ~/.pypirc`` so that only you can read/write the file. diff --git a/docs/source/dev-guide/release/release-steps-old.rst b/docs/source/dev-guide/release/release-steps-old.rst new file mode 100644 index 000000000..462eb9f75 --- /dev/null +++ b/docs/source/dev-guide/release/release-steps-old.rst @@ -0,0 +1,112 @@ +:orphan: + + +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: + +.. code-block:: bash + + $ git pull origin master + +3. Add a new entry in the Changelog for the release. + +.. code-block:: python + + ## [0.0.6] + ### [Breaking Changes] + ### [Added] + ### [Changed] + ### [Deprecated] + ### [Removed] + +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``. + +5. Commit these changes and create a PR: + +.. 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. + +7. Tag the release: + +.. code-block:: bash + + git tag -a v0.0.6 -m "v0.0.6 release" + git push origin v0.0.6 + +8. Build the source and wheel distributions: + +.. 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] + +15. Commit these changes and create a PR: + +.. 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 `_ diff --git a/docs/source/dev-guide/release/release-steps.rst b/docs/source/dev-guide/release/release-steps.rst index baf33e38b..f1d30b04f 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