-
Notifications
You must be signed in to change notification settings - Fork 300
automate sdist and wheel build and publish #4849
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
12 commits
Select commit
Hold shift + click to select a range
cc997fa
automate sdist and wheel build and publish
bjlittle 3f28aa3
update names
bjlittle 13824d8
tidy package manifest and discovery
bjlittle 0adba3a
add note to dev docs
bjlittle 42a7a59
update MANIFEST.in
bjlittle d7c61d3
Update .github/workflows/ci-wheels.yml
bjlittle 2341746
add unshallow comment to rtd
bjlittle 0565db3
reinstate docs release
bjlittle 41b2e8d
add pypa build comment
bjlittle 373afbb
test wheel
bjlittle 893e166
added whatnew + tweak nox wheel emsgs
bjlittle cd88820
Update docs/src/developers_guide/release.rst
bjlittle 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
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 |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| # Reference: | ||
| # - https://github.com/actions/checkout | ||
| # - https://github.com/actions/download-artifact | ||
| # - https://github.com/actions/upload-artifact | ||
| # - https://github.com/pypa/build | ||
| # - https://github.com/pypa/gh-action-pypi-publish | ||
| # - https://test.pypi.org/help/#apitoken | ||
|
|
||
| name: ci-wheels | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| push: | ||
| tags: | ||
| - "v*" | ||
| branches-ignore: | ||
| - "auto-update-lockfiles" | ||
| - "pre-commit-ci-update-config" | ||
| - "dependabot/*" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: "build sdist & wheel" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "building" | ||
| shell: bash | ||
| run: | | ||
| # require build with explicit --sdist and --wheel in order to | ||
| # get correct version associated with sdist and bdist artifacts | ||
| pipx run build --sdist --wheel | ||
|
|
||
| - uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: pypi-artifacts | ||
| path: ${{ github.workspace }}/dist/* | ||
|
|
||
| test-wheel: | ||
| needs: build | ||
| name: "test wheel (py${{ matrix.python-version }})" | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10"] | ||
| session: ["wheel"] | ||
| env: | ||
| ENV_NAME: "ci-wheels" | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: pypi-artifacts | ||
| path: ${{ github.workspace }}/dist | ||
|
|
||
| - name: "environment configure" | ||
| env: | ||
| # Maximum cache period (in weeks) before forcing a cache refresh. | ||
| CACHE_WEEKS: 2 | ||
| run: | | ||
| echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV} | ||
| echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV} | ||
|
|
||
| - name: "conda package cache" | ||
| uses: ./.github/workflows/composite/conda-pkg-cache | ||
| with: | ||
| cache_build: 0 | ||
| cache_period: ${{ env.CACHE_PERIOD }} | ||
| env_name: ${{ env.ENV_NAME }} | ||
|
|
||
| - name: "conda install" | ||
| uses: conda-incubator/setup-miniconda@v2 | ||
| with: | ||
| miniforge-version: latest | ||
| channels: conda-forge,defaults | ||
| activate-environment: ${{ env.ENV_NAME }} | ||
| auto-update-conda: false | ||
| use-only-tar-bz2: true | ||
|
|
||
| - name: "conda environment cache" | ||
| uses: ./.github/workflows/composite/conda-env-cache | ||
| with: | ||
| cache_build: 0 | ||
| cache_period: ${{ env.CACHE_PERIOD }} | ||
| env_name: ${{ env.ENV_NAME }} | ||
| install_packages: "nox pip" | ||
|
|
||
| - name: "nox cache" | ||
| uses: ./.github/workflows/composite/nox-cache | ||
| with: | ||
| cache_build: 0 | ||
| env_name: ${{ env.ENV_NAME }} | ||
| lock_file: ${{ env.LOCK_FILE }} | ||
|
|
||
| - name: "nox install and test wheel" | ||
| env: | ||
| PY_VER: ${{ matrix.python-version }} | ||
| run: | | ||
| nox --session ${{ matrix.session }} -- --verbose | ||
|
|
||
| show-artifacts: | ||
| needs: build | ||
| name: "show artifacts" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: pypi-artifacts | ||
| path: ${{ github.workspace }}/dist | ||
|
|
||
| - shell: bash | ||
| run: | | ||
| ls -l ${{ github.workspace }}/dist | ||
|
|
||
trexfeathers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| publish-artifacts-test-pypi: | ||
| needs: test-wheel | ||
| name: "publish to test.pypi" | ||
| runs-on: ubuntu-latest | ||
| # upload to Test PyPI for every commit on main branch | ||
| if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' | ||
| steps: | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: pypi-artifacts | ||
| path: ${{ github.workspace }}/dist | ||
|
|
||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
| repository_url: https://test.pypi.org/legacy/ | ||
| skip_existing: true | ||
| print_hash: true | ||
|
|
||
| publish-artifacts-pypi: | ||
| needs: test-wheel | ||
| name: "publish to pypi" | ||
| runs-on: ubuntu-latest | ||
| # upload to PyPI for every tag starting with 'v' | ||
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
| steps: | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: pypi-artifacts | ||
| path: ${{ github.workspace }}/dist | ||
|
|
||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
| print_hash: true | ||
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
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
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
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
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
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
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
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.