From 812a7c0e3fdbccefccc02f635e1c51ad4b6b4123 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Fri, 25 Nov 2022 17:50:48 -0800 Subject: [PATCH 1/9] nightly build action --- .github/workflows/pypi-nightly-build.yml | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/pypi-nightly-build.yml diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml new file mode 100644 index 00000000000..2163af5a82d --- /dev/null +++ b/.github/workflows/pypi-nightly-build.yml @@ -0,0 +1,57 @@ +name: pypi-publish-nightly +on: push + # schedule: + # - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST + +jobs: + # nightly release check from https://stackoverflow.com/a/67527144 + check-date: + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.should_run.outputs.should_run }} + steps: + - uses: actions/checkout@v2 + - name: print latest_commit + run: echo ${{ github.sha }} + - id: should_run + continue-on-error: true + name: check latest commit is less than a day + if: ${{ github.event_name == 'schedule' }} + run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" + + nightly-build-test-pypi: + runs-on: ubuntu-latest + needs: check-date + if: ${{ needs.check_date.outputs.should_run != 'false' }} + steps: + - name: Clone repository + uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' # caching pip dependencies + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Set release version + run: | + RELEASE_VERSION=$(date +%Y.%m.%d) + sed -i 's/{{SKYPILOT_COMMIT_SHA}}/${{ github.sha }}/g' sky/__init__.py + sed -i 's/__version__ = '.*'/__version__ = '1.0.0-dev${RELEASE_VERSION}'/g' sky/__init__.py + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ From d494d4dc4a6e4b6ab4e557b8b559abb1470af53f Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Fri, 25 Nov 2022 18:02:17 -0800 Subject: [PATCH 2/9] fix --- .github/workflows/pypi-nightly-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index 2163af5a82d..edb460a6071 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -41,7 +41,7 @@ jobs: run: | RELEASE_VERSION=$(date +%Y.%m.%d) sed -i 's/{{SKYPILOT_COMMIT_SHA}}/${{ github.sha }}/g' sky/__init__.py - sed -i 's/__version__ = '.*'/__version__ = '1.0.0-dev${RELEASE_VERSION}'/g' sky/__init__.py + sed -i "s/__version__ = '.*'/__version__ = '1.0.0-dev${RELEASE_VERSION}'/g" sky/__init__.py - name: Build a binary wheel and a source tarball run: >- python -m From 2e29486cf3a9f38bb89dc2f317af49d9b9164d5b Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Fri, 25 Nov 2022 18:11:10 -0800 Subject: [PATCH 3/9] Fix version number --- .github/workflows/pypi-nightly-build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index edb460a6071..83a38ba1768 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -1,5 +1,8 @@ name: pypi-publish-nightly -on: push +on: + push: + branches: + - master # schedule: # - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST @@ -39,7 +42,7 @@ jobs: --user - name: Set release version run: | - RELEASE_VERSION=$(date +%Y.%m.%d) + RELEASE_VERSION=$(date +%Y%m%d) sed -i 's/{{SKYPILOT_COMMIT_SHA}}/${{ github.sha }}/g' sky/__init__.py sed -i "s/__version__ = '.*'/__version__ = '1.0.0-dev${RELEASE_VERSION}'/g" sky/__init__.py - name: Build a binary wheel and a source tarball From 4662c6c66e6a6a41337a48d4eff50c916e8d5a5a Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Fri, 25 Nov 2022 20:50:17 -0800 Subject: [PATCH 4/9] push to skypilot-nightly --- .github/workflows/pypi-nightly-build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index 83a38ba1768..5cce2146893 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -1,10 +1,7 @@ name: pypi-publish-nightly on: - push: - branches: - - master - # schedule: - # - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST + schedule: + - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST jobs: # nightly release check from https://stackoverflow.com/a/67527144 @@ -22,7 +19,7 @@ jobs: if: ${{ github.event_name == 'schedule' }} run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - nightly-build-test-pypi: + nightly-build-pypi: runs-on: ubuntu-latest needs: check-date if: ${{ needs.check_date.outputs.should_run != 'false' }} @@ -43,8 +40,9 @@ jobs: - name: Set release version run: | RELEASE_VERSION=$(date +%Y%m%d) - sed -i 's/{{SKYPILOT_COMMIT_SHA}}/${{ github.sha }}/g' sky/__init__.py + sed -i "s/{{SKYPILOT_COMMIT_SHA}}/${{ github.sha }}/g" sky/__init__.py sed -i "s/__version__ = '.*'/__version__ = '1.0.0-dev${RELEASE_VERSION}'/g" sky/__init__.py + sed -i "s/name='skypilot',/name='skypilot-nightly',/g" sky/setup_files/setup.py - name: Build a binary wheel and a source tarball run: >- python -m @@ -58,3 +56,8 @@ jobs: with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + From 1529511d0d13a88a2c5799338f5f97cdda174399 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Fri, 25 Nov 2022 21:06:36 -0800 Subject: [PATCH 5/9] Fix --- .github/workflows/pypi-nightly-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index 5cce2146893..e4b367b03ee 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -56,7 +56,7 @@ jobs: with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - - name: Publish distribution to Test PyPI + - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} From ac66fae3e251a811f3a453eeeb98f530dbb3c00d Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Thu, 13 Jul 2023 09:13:46 -0700 Subject: [PATCH 6/9] fix url --- .github/workflows/pypi-nightly-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index e4b367b03ee..43e83be8ef0 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -55,7 +55,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 5864399925058b0ffdd68d4c9319bd2ea3610912 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Thu, 13 Jul 2023 09:15:29 -0700 Subject: [PATCH 7/9] test the action --- .github/workflows/pypi-nightly-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index 43e83be8ef0..79aa922e2fe 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -1,7 +1,7 @@ name: pypi-publish-nightly -on: - schedule: - - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST +on: push + # schedule: + # - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST jobs: # nightly release check from https://stackoverflow.com/a/67527144 From ee1e57639f84a8143b18e7f8c8af55c4de462ef1 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Thu, 13 Jul 2023 09:19:18 -0700 Subject: [PATCH 8/9] change back to schedule --- .github/workflows/pypi-nightly-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index 79aa922e2fe..43e83be8ef0 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -1,7 +1,7 @@ name: pypi-publish-nightly -on: push - # schedule: - # - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST +on: + schedule: + - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST jobs: # nightly release check from https://stackoverflow.com/a/67527144 From 591847564f10935915aef58d6e598c8297f86959 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Thu, 13 Jul 2023 20:39:02 -0700 Subject: [PATCH 9/9] Add workflow dispatch --- .github/workflows/pypi-nightly-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pypi-nightly-build.yml b/.github/workflows/pypi-nightly-build.yml index 43e83be8ef0..6c46afa11fe 100644 --- a/.github/workflows/pypi-nightly-build.yml +++ b/.github/workflows/pypi-nightly-build.yml @@ -2,6 +2,7 @@ name: pypi-publish-nightly on: schedule: - cron: '35 10 * * *' # 10:35am UTC, 2:35am PST, 5:35am EST + workflow_dispatch: jobs: # nightly release check from https://stackoverflow.com/a/67527144