-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pypi] Automatically release nightly version of skypilot #1446
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
812a7c0
nightly build action
Michaelvll d494d4d
fix
Michaelvll 2e29486
Fix version number
Michaelvll 4662c6c
push to skypilot-nightly
Michaelvll 1529511
Fix
Michaelvll a0225ea
Merge branch 'master' of github.com:concretevitamin/sky-experiments i…
Michaelvll 9ec0b88
Merge branch 'master' of github.com:skypilot-org/skypilot into nightl…
Michaelvll ac66fae
fix url
Michaelvll 5864399
test the action
Michaelvll ee1e576
change back to schedule
Michaelvll 5918475
Add workflow dispatch
Michaelvll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
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 | ||
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-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 | ||
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 | ||
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/ | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One reason I prefer to let the user use the nightly instead of the master branch is that we can then note the commit hash of the users in the dashboard.