Skip to content

Commit

Permalink
Test unzip to a given directory
Browse files Browse the repository at this point in the history
  • Loading branch information
lexiforest committed Oct 22, 2024
1 parent 86a62f2 commit cf58c7e
Showing 1 changed file with 63 additions and 49 deletions.
112 changes: 63 additions & 49 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
pip install mypy ruff
make lint
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
pip install mypy ruff
make lint
sdist:
name: Build sdist wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: build sdist
run: |
make preprocess
pip install build
python -m build --sdist
pip install ./dist/*.tar.gz
- name: build sdist
run: |
make preprocess
pip install build
python -m build --sdist
pip install ./dist/*.tar.gz
- name: upload artifacts
uses: actions/upload-artifact@v4 # https://github.com/actions/upload-artifact/issues/478
with:
name: curl_cffi-${{ github.sha }}-sdist.zip
path: ./dist/*.tar.gz
- name: upload artifacts
uses: actions/upload-artifact@v4 # https://github.com/actions/upload-artifact/issues/478
with:
name: curl_cffi-${{ github.sha }}-sdist.zip
path: ./dist/*.tar.gz

bdist:
name: Build bdist wheels and test
Expand All @@ -57,32 +57,43 @@ jobs:
matrix:
os: [ubuntu-22.04, macos-12, macos-14, windows-2019]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

# macOS make is too old
- if: runner.os == 'macOS'
run: |
brew install make automake libtool
# macOS make is too old
- if: runner.os == 'macOS'
run: |
brew install make automake libtool
- name: Build and test wheels
uses: pypa/[email protected]

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- uses: actions/upload-artifact@v4 # https://github.com/actions/upload-artifact/issues/478
with:
name: curl_cffi-${{ github.sha }}-${{ matrix.os }}.zip
path: ./wheelhouse/*.whl

- name: Build and test wheels
uses: pypa/[email protected]
- uses: actions/[email protected] # https://github.com/actions/upload-artifact/issues/478
if: startsWith(github.ref, 'refs/tags/')
with:
pattern: curl_cffi-*
path: dist

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- run: |
unzip dist/*.zip -d dist
ls -al
- uses: actions/upload-artifact@v4 # https://github.com/actions/upload-artifact/issues/478
with:
name: curl_cffi-${{ github.sha }}-${{ matrix.os }}.zip
path: ./wheelhouse/*.whl
upload_all:
needs: [bdist, sdist]
Expand All @@ -93,16 +104,19 @@ jobs:
with:
pattern: curl_cffi-*
path: dist
- run: |
gunzip *.zip
ls -al
# - uses: pypa/[email protected]
# if: startsWith(github.ref, 'refs/tags/')
# with:
# password: ${{ secrets.PYPI_TOKEN }}

- name: Upload release files
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
./dist/*.whl
./dist/*.tar.gz
# - name: Upload release files
# if: startsWith(github.ref, 'refs/tags/')
# uses: softprops/action-gh-release@v2
# with:
# files: |
# ./dist/*.whl
# ./dist/*.tar.gz

0 comments on commit cf58c7e

Please sign in to comment.