From 19150698b42342723b18a091f0be7d315dcf9f5d Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:16:57 -0600 Subject: [PATCH 01/10] split build-release into a workflow for dist- and docs-release --- .github/workflows/build-release.yml | 78 ----------------------------- 1 file changed, 78 deletions(-) delete mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index 877ecfd7..00000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: build-release - -on: - pull_request: - types: [opened, synchronize] - push: - branches: ['master'] - -jobs: - release: - runs-on: ubuntu-latest - environment: release - permissions: - # Used to authenticate to PyPI via OIDC and sign the release's artifacts with sigstore-python. - id-token: write - # Used to attach signing artifacts to the published release. - contents: write - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - - - name: Build dist - working-directory: ./python - run: tox -e build-dist - - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - if: startsWith(github.ref, 'refs/tags/v') - with: - packages-dir: python/dist/ - - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - - - name: Build docs - working-directory: ./python - run: tox -e build-docs - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: html-docs - path: docs/_build/html/ - - - name: Deploy 🚀 - uses: peaceiris/actions-gh-pages@v3 - if: startsWith(github.ref, 'refs/tags/v') - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/_build/html From 4799e4935de4ceaa992072c2249ce4cd6585f3fc Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:17:17 -0600 Subject: [PATCH 02/10] split build-release into a workflow for dist- and docs-release --- .github/workflows/dist-releasae.yml | 47 +++++++++++++++++++++++++++++ .github/workflows/docs-release.yml | 44 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .github/workflows/dist-releasae.yml create mode 100644 .github/workflows/docs-release.yml diff --git a/.github/workflows/dist-releasae.yml b/.github/workflows/dist-releasae.yml new file mode 100644 index 00000000..35acdd31 --- /dev/null +++ b/.github/workflows/dist-releasae.yml @@ -0,0 +1,47 @@ +name: code-release + +on: + pull_request: + types: [opened, synchronize] + paths-ignore: + - 'docs/**' # Ignore changes in the docs folder for pull requests + push: + branches: ['master'] + paths-ignore: + - 'docs/**' # Ignore changes in the docs folder for pushes + +jobs: + release: + runs-on: ubuntu-latest + environment: release + permissions: + # Used to authenticate to PyPI via OIDC and sign the release's artifacts with sigstore-python. + id-token: write + # Used to attach signing artifacts to the published release. + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + + - name: Build dist + working-directory: ./python + run: tox -e build-dist + + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + packages-dir: python/dist/ diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml new file mode 100644 index 00000000..8c2fbe9a --- /dev/null +++ b/.github/workflows/docs-release.yml @@ -0,0 +1,44 @@ +name: docs-release + +on: + push: + branches: ['master'] + paths: + - 'docs/**' # Trigger only when files inside docs folder are changed + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + + - name: Build docs + working-directory: ./python + run: tox -e build-docs + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: html-docs + path: docs/_build/html/ + + - name: Deploy 🚀 + uses: peaceiris/actions-gh-pages@v3 + if: startsWith(github.ref, 'refs/tags/v') + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/_build/html From 312ba3febfbd0ef817c4a3fa2a372cf5b10f4476 Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:24:41 -0600 Subject: [PATCH 03/10] rename gh job in dist-release --- .github/workflows/dist-releasae.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dist-releasae.yml b/.github/workflows/dist-releasae.yml index 35acdd31..69ace656 100644 --- a/.github/workflows/dist-releasae.yml +++ b/.github/workflows/dist-releasae.yml @@ -1,4 +1,4 @@ -name: code-release +name: dist-release on: pull_request: From 02b48a8b20cf1359a826e02ff445d905bb9a1585 Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:28:18 -0600 Subject: [PATCH 04/10] adding to trigger docs workflow --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index dfe086b3..cbc8f936 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ tempo - Time Series Utilities for Data Teams Using Databricks :hidden: :maxdepth: 3 - Databricks Labs + Databricks BLabs about/user-guide references/api-reference about/contributing From 646155c3e86b2a2d6785eed2997d407a490198e6 Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:33:23 -0600 Subject: [PATCH 05/10] reverting doc change --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index cbc8f936..dfe086b3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ tempo - Time Series Utilities for Data Teams Using Databricks :hidden: :maxdepth: 3 - Databricks BLabs + Databricks Labs about/user-guide references/api-reference about/contributing From 4f7fcfc9359b706464233ad9f890a8157ef6c72e Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:34:50 -0600 Subject: [PATCH 06/10] ignore changes inside .github dir for dist build workflow --- .github/workflows/dist-releasae.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dist-releasae.yml b/.github/workflows/dist-releasae.yml index 69ace656..907227aa 100644 --- a/.github/workflows/dist-releasae.yml +++ b/.github/workflows/dist-releasae.yml @@ -5,10 +5,12 @@ on: types: [opened, synchronize] paths-ignore: - 'docs/**' # Ignore changes in the docs folder for pull requests + - '.github' # Ignore changes in the .github folder for pull requests push: branches: ['master'] paths-ignore: - 'docs/**' # Ignore changes in the docs folder for pushes + - '.github' # Ignore changes in the .github folder for pushes jobs: release: From 5ac1c9d9dac35145312d9c467e92ead7d69008aa Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:53:45 -0600 Subject: [PATCH 07/10] update workflow triggers to include push to master, PR change and workflow dispatch --- .github/workflows/docs-release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 8c2fbe9a..84dee39c 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -4,7 +4,12 @@ on: push: branches: ['master'] paths: - - 'docs/**' # Trigger only when files inside docs folder are changed + - 'docs/**' # Trigger when files inside docs folder are changed + pull_request: + paths: + - 'docs/**' # Trigger when docs are changed within a pull request + workflow_dispatch: # Allow manual triggering of the workflow + jobs: docs: From 7893ad6ee0e91bd6ae51a372a5d4769519e8a52c Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:54:19 -0600 Subject: [PATCH 08/10] update to deploy if version changes or workflow is manually triggered --- .github/workflows/docs-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 84dee39c..35c45dba 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -43,7 +43,8 @@ jobs: - name: Deploy 🚀 uses: peaceiris/actions-gh-pages@v3 - if: startsWith(github.ref, 'refs/tags/v') + # Deploy to the gh-pages branch when a tag is pushed or the workflow is manually triggered + if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/_build/html From cef461aa4ff28ca0a9e37b769bab8c5893ccd3de Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:56:21 -0600 Subject: [PATCH 09/10] change docs to trigger workflow --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index dfe086b3..cbc8f936 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ tempo - Time Series Utilities for Data Teams Using Databricks :hidden: :maxdepth: 3 - Databricks Labs + Databricks BLabs about/user-guide references/api-reference about/contributing From ebf6ac835f2fbe9889ad92411d5bd73588df9944 Mon Sep 17 00:00:00 2001 From: Lorin Date: Tue, 1 Oct 2024 21:57:26 -0600 Subject: [PATCH 10/10] Revert "change docs to trigger workflow" This reverts commit cef461aa4ff28ca0a9e37b769bab8c5893ccd3de. --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index cbc8f936..dfe086b3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ tempo - Time Series Utilities for Data Teams Using Databricks :hidden: :maxdepth: 3 - Databricks BLabs + Databricks Labs about/user-guide references/api-reference about/contributing