-
Notifications
You must be signed in to change notification settings - Fork 54
Update GitHub Actions workflow for PyPI release #158
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9ef5806
Update GitHub Actions workflow for PyPI release
MMathisLab 50b7644
Add missing twine installation to PyPI release workflow (#159)
Copilot ee11326
Apply suggestion from @Copilot
MMathisLab b62454b
Apply suggestions from code review
MMathisLab f2deb31
Replace `make dist` with `python -m build` in PyPI workflow (#160)
Copilot 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 hidden or 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 |
|---|---|---|
| @@ -1,32 +1,59 @@ | ||
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
| name: Python package | ||
| name: Update pypi release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| tags: | ||
| - 'v*.*.*' | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| branches: | ||
| - main | ||
| - public | ||
| types: | ||
| - labeled | ||
| - opened | ||
| - edited | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| release: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| # You can use PyPy versions in python-version. For example, pypy2 and pypy3 | ||
| matrix: | ||
| python-version: ["3.10"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| # You can test your matrix by printing the current Python version | ||
| - name: Display Python version | ||
| run: python -c "import sys; print(sys.version)" | ||
| #test installation of DLC-core dependencies: | ||
| - name: Install dependencies | ||
| run: pip install . | ||
| - name: Setup Python | ||
| id: setup-python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.x' | ||
|
|
||
| - name: Cache dependencies | ||
| id: pip-cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements.txt', 'setup.cfg', 'setup.py') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}- | ||
| ${{ runner.os }}-pip- | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install wheel | ||
| pip install "packaging>=24.2" | ||
| pip install build | ||
| pip install twine | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build and publish to PyPI | ||
| if: ${{ github.event_name == 'push' }} | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
| run: | | ||
| python -m build | ||
| ls dist/ | ||
| tar tvf dist/deeplabcut_live-*.tar.gz | ||
| python3 -m twine upload --verbose dist/* | ||
MMathisLab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.