-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix timeout when retrying uploads (#90)
- Loading branch information
Showing
9 changed files
with
184 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
name: Build and publish | ||
|
||
# Run on PR requests. And on master itself. | ||
on: | ||
push: | ||
branches: | ||
- main # just build the sdist skip release | ||
tags: | ||
- "*" | ||
pull_request: # also build on PRs touching some files | ||
paths: | ||
- ".github/workflows/release.yml" | ||
- "MANIFEST.in" | ||
- "setup.cfg" | ||
- "setup.py" | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Build a source tarball | ||
run: | | ||
python -m pip install --upgrade setuptools wheel | ||
python setup.py sdist bdist_wheel | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./dist/* | ||
retention-days: 5 | ||
|
||
publish: | ||
name: Publish on GitHub and PyPI | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
# release on every tag | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Get Asset name | ||
run: | | ||
export PKG=$(ls dist/ | grep tar) | ||
set -- $PKG | ||
echo "name=$1" >> $GITHUB_ENV | ||
- name: Upload Release Asset (sdist) to GitHub | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/${{ env.name }} | ||
asset_name: ${{ env.name }} | ||
asset_content_type: application/zip | ||
|
||
- name: Upload Release Assets to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_UPLOAD_TOKEN }} |
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,49 @@ | ||
name: Linux | ||
|
||
# Run on PR requests. And on master itself. | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
TestLinux: | ||
name: Linux, Python ${{ matrix.python }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# 2019 | ||
- python: 3.8 | ||
pins: "certifi==2019.* urllib3==1.24.* aiohttp==3.6.3 aiofiles==0.6.*" | ||
# 2021 | ||
- python: 3.9 | ||
pins: "certifi==2021.* urllib3==1.26.6 aiohttp==3.7.* aiofiles==0.7.*" | ||
# 2022 | ||
- python: "3.10" | ||
pins: "certifi==2022.* urllib3==1.26.* aiohttp==3.8.* aiofiles==0.8.*" | ||
# current | ||
- python: "3.11" | ||
pins: "" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install python dependencies | ||
shell: bash | ||
run: | | ||
pip install --disable-pip-version-check --upgrade pip setuptools wheel | ||
pip install ${{ matrix.pins }} .[aio,test] | ||
pip list | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
pytest |
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
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
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
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
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
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