From e1261295dd96a9f12b80c1e9cceaa25790c2aef3 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 29 Nov 2021 22:51:20 -0500 Subject: [PATCH 01/14] update release workflow to support macos arm64 --- .github/workflows/ci.yml | 217 +--------------------------------- .github/workflows/release.yml | 213 +++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+), 216 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a23108e..42de962 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,12 +5,6 @@ on: branches: - master pull_request: - workflow_dispatch: - inputs: - publish: - description: 'Publish to PyPI (true/false)' - required: true - default: 'false' jobs: build: @@ -27,7 +21,7 @@ jobs: override: true - uses: actions-rs/cargo@v1 with: - command: build + command: build args: --tests test: @@ -59,212 +53,3 @@ jobs: with: command: fmt args: --all -- --check - - python-macos: - needs: [build, test, fmt] - name: Build macos - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true - - name: Build wheels - x86_64 - uses: messense/maturin-action@v1 - with: - target: x86_64 - args: --release --out dist - - name: Install built wheel - x86_64 - run: | - pip install dbt_extractor --no-index --find-links dist --force-reinstall - python -c "import dbt_extractor" - - name: Build wheels - universal2 - uses: messense/maturin-action@v1 - with: - args: -i python --release --universal2 --out dist --no-sdist - - name: Install built wheel - universal2 - run: | - pip install dbt_extractor --no-index --find-links dist --force-reinstall - python -c "import dbt_extractor" - - name: Show wheels generated - run: ls -lh dist/ - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - name: wheels - path: dist - - python-windows: - needs: [build, test, fmt] - name: Build windows ${{ matrix.target }} - runs-on: windows-latest - strategy: - matrix: - target: [x64, x86] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - architecture: ${{ matrix.target }} - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - architecture: ${{ matrix.target }} - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - architecture: ${{ matrix.target }} - - uses: actions/setup-python@v2 - with: - python-version: 3.6 - architecture: ${{ matrix.target }} - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true - - name: Build wheels - uses: messense/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist --no-sdist - - name: Install built wheel - run: | - pip install dbt_extractor --no-index --find-links dist --force-reinstall - python -c "import dbt_extractor" - - name: Show wheels generated - run: ls -lh dist - shell: bash - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - name: wheels - path: dist - - python-linux: - needs: [build, test, fmt] - name: Build linux ${{ matrix.target }} - runs-on: ubuntu-latest - strategy: - matrix: - target: [x86_64, i686] - steps: - - uses: actions/checkout@v2 - # the native python is only used to test that the package can be installed - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - # supported python versions - # https://github.com/messense/maturin-action/blob/51478586be5dfb16a569cb6bbec182fba9f13f79/src/index.ts#L245 - - name: Build Wheels - uses: messense/maturin-action@v1 - with: - target: ${{ matrix.target }} - manylinux: auto - args: --release --out dist --no-sdist - - name: Install built wheel - if: matrix.target == 'x86_64' - run: | - pip install dbt_extractor --no-index --find-links dist --force-reinstall - python -c "import dbt_extractor" - - name: Show wheels generated - run: ls -lh dist/ - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - name: wheels - path: dist - - python-linux-cross: - needs: [build, test, fmt] - name: Build py${{ matrix.python.version }} linux-cross ${{ matrix.target }} - runs-on: ubuntu-latest - strategy: - matrix: - python: [ - { version: '3.6', abi: 'cp36-cp36m' }, - { version: '3.7', abi: 'cp37-cp37m' }, - { version: '3.8', abi: 'cp38-cp38' }, - { version: '3.9', abi: 'cp39-cp39' }, - ] - target: [aarch64, armv7, s390x, ppc64le, ppc64] - env: - PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib - steps: - - uses: actions/checkout@v2 - - name: Build Wheels - uses: messense/maturin-action@v1 - with: - target: ${{ matrix.target }} - manylinux: auto - args: -i python${{ matrix.python.version }} --release --out dist --no-sdist - - uses: uraimo/run-on-arch-action@v2.0.5 - if: matrix.target != 'ppc64' - name: Install built wheel - with: - arch: ${{ matrix.target }} - distro: ubuntu20.04 - githubToken: ${{ github.token }} - # Mount the dist directory as /artifacts in the container - dockerRunArgs: | - --volume "${PWD}/dist:/artifacts" - install: | - apt-get update - apt-get install -y --no-install-recommends python3 python3-pip software-properties-common - add-apt-repository ppa:deadsnakes/ppa - apt-get update - apt-get install -y python3.6 python3.7 python3.9 - run: | - ls -lrth /artifacts - PYTHON=python${{ matrix.python.version }} - $PYTHON -m pip install -U pip - $PYTHON -m pip install dbt_extractor --no-index --find-links /artifacts --force-reinstall - $PYTHON -c 'import dbt_extractor' - - name: Show wheels generated - run: ls -lh dist/ - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - name: wheels - path: dist - - publish: - needs: [python-macos, python-windows, python-linux, python-linux-cross] - name: Publish to PyPI - environment: - name: pypi-prod - runs-on: ubuntu-latest - if: ${{ github.event.inputs.publish == 'true' }} - steps: - - uses: actions/download-artifact@v2 - with: - name: wheels - - name: Show wheels generated - run: ls -lh ./ - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Publish to PyPi - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - pip install --upgrade twine - twine upload --skip-existing * diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0f89736 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,213 @@ +name: Release + +on: + workflow_dispatch: + inputs: + publish: + description: "Publish to PyPI (true/false)" + required: true + default: "false" + +jobs: + python-macos: + name: Build macos + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + - uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + default: true + - name: Build wheels - x86_64 + uses: messense/maturin-action@v1 + with: + target: x86_64 + args: --release --out dist + - name: Build wheels - arm64 + uses: messense/maturin-action@v1 + with: + target: arm64 + args: -i python --release --out dist --no-sdist + - name: Build wheels - universal2 + uses: messense/maturin-action@v1 + with: + args: -i python --release --universal2 --out dist --no-sdist + - name: Show wheels generated + run: ls -lh dist/ + - name: Upload wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist + + python-windows: + name: Build windows ${{ matrix.target }} + runs-on: windows-latest + strategy: + matrix: + target: [x64, x86] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + architecture: ${{ matrix.target }} + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: ${{ matrix.target }} + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + architecture: ${{ matrix.target }} + - uses: actions/setup-python@v2 + with: + python-version: 3.6 + architecture: ${{ matrix.target }} + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + default: true + - name: Build wheels + uses: messense/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --no-sdist + - name: Install built wheel + run: | + pip install dbt_extractor --no-index --find-links dist --force-reinstall + python -c "import dbt_extractor" + - name: Show wheels generated + run: ls -lh dist + shell: bash + - name: Upload wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist + + python-linux: + name: Build linux ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + matrix: + target: [x86_64, i686] + steps: + - uses: actions/checkout@v2 + # the native python is only used to test that the package can be installed + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + # supported python versions + # https://github.com/messense/maturin-action/blob/51478586be5dfb16a569cb6bbec182fba9f13f79/src/index.ts#L245 + - name: Build Wheels + uses: messense/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: auto + args: --release --out dist --no-sdist + - name: Install built wheel + if: matrix.target == 'x86_64' + run: | + pip install dbt_extractor --no-index --find-links dist --force-reinstall + python -c "import dbt_extractor" + - name: Show wheels generated + run: ls -lh dist/ + - name: Upload wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist + + python-linux-cross: + name: Build py${{ matrix.python.version }} linux-cross ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + matrix: + python: + [ + { version: "3.6", abi: "cp36-cp36m" }, + { version: "3.7", abi: "cp37-cp37m" }, + { version: "3.8", abi: "cp38-cp38" }, + { version: "3.9", abi: "cp39-cp39" }, + ] + target: [aarch64, armv7, s390x, ppc64le, ppc64] + env: + PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib + steps: + - uses: actions/checkout@v2 + - name: Build Wheels + uses: messense/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: auto + args: -i python${{ matrix.python.version }} --release --out dist --no-sdist + - uses: uraimo/run-on-arch-action@v2.0.5 + if: matrix.target != 'ppc64' + name: Install built wheel + with: + arch: ${{ matrix.target }} + distro: ubuntu20.04 + githubToken: ${{ github.token }} + # Mount the dist directory as /artifacts in the container + dockerRunArgs: | + --volume "${PWD}/dist:/artifacts" + install: | + apt-get update + apt-get install -y --no-install-recommends python3 python3-pip software-properties-common + add-apt-repository ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.6 python3.7 python3.9 + run: | + ls -lrth /artifacts + PYTHON=python${{ matrix.python.version }} + $PYTHON -m pip install -U pip + $PYTHON -m pip install dbt_extractor --no-index --find-links /artifacts --force-reinstall + $PYTHON -c 'import dbt_extractor' + - name: Show wheels generated + run: ls -lh dist/ + - name: Upload wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist + + publish: + needs: [python-macos, python-windows, python-linux, python-linux-cross] + name: Publish to PyPI + environment: + name: pypi-prod + runs-on: ubuntu-latest + if: ${{ github.event.inputs.publish == 'true' }} + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + - name: Show wheels generated + run: ls -lh ./ + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Publish to PyPi + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + pip install --upgrade twine + twine upload --skip-existing * From 0731914f8759e4322f86916542ff08f8b289ecfe Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 29 Nov 2021 22:52:05 -0500 Subject: [PATCH 02/14] master -> main --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42de962..5fa5518 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - master + - main pull_request: jobs: From 827c5f9ac9ab356da4a43d445edd418dba51f6e2 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 3 Dec 2021 13:18:24 -0500 Subject: [PATCH 03/14] build macos for py3.6, 3.7, 3.8, 3.9 --- .github/workflows/release.yml | 70 ++++++++++++++++------------------- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f89736..0ad06d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,25 +7,22 @@ on: description: "Publish to PyPI (true/false)" required: true default: "false" + pull_request: jobs: python-macos: - name: Build macos + name: Build macos py${{ matrix.python-version }} runs-on: macos-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + env: + PYO3_CROSS_LIB_DIR: '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/${{ matrix.python-version }}/lib' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.9 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - uses: actions/setup-python@v2 - with: - python-version: 3.6 + python-version: ${{ matrix.python-version }} - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -37,11 +34,6 @@ jobs: with: target: x86_64 args: --release --out dist - - name: Build wheels - arm64 - uses: messense/maturin-action@v1 - with: - target: arm64 - args: -i python --release --out dist --no-sdist - name: Build wheels - universal2 uses: messense/maturin-action@v1 with: @@ -188,26 +180,26 @@ jobs: name: wheels path: dist - publish: - needs: [python-macos, python-windows, python-linux, python-linux-cross] - name: Publish to PyPI - environment: - name: pypi-prod - runs-on: ubuntu-latest - if: ${{ github.event.inputs.publish == 'true' }} - steps: - - uses: actions/download-artifact@v2 - with: - name: wheels - - name: Show wheels generated - run: ls -lh ./ - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Publish to PyPi - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - pip install --upgrade twine - twine upload --skip-existing * + # publish: + # needs: [python-macos, python-windows, python-linux, python-linux-cross] + # name: Publish to PyPI + # environment: + # name: pypi-prod + # runs-on: ubuntu-latest + # if: ${{ github.event.inputs.publish == 'true' }} + # steps: + # - uses: actions/download-artifact@v2 + # with: + # name: wheels + # - name: Show wheels generated + # run: ls -lh ./ + # - uses: actions/setup-python@v2 + # with: + # python-version: 3.9 + # - name: Publish to PyPi + # env: + # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + # run: | + # pip install --upgrade twine + # twine upload --skip-existing * From 104e2a6dc134d69d696b7ac996e902b428ba85fd Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 3 Dec 2021 13:35:05 -0500 Subject: [PATCH 04/14] test --- .github/workflows/release.yml | 8 +++++--- .gitignore | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ad06d7..3022e98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,6 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] - env: - PYO3_CROSS_LIB_DIR: '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/${{ matrix.python-version }}/lib' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -36,8 +34,12 @@ jobs: args: --release --out dist - name: Build wheels - universal2 uses: messense/maturin-action@v1 + env: + # DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer + # MACOSX_DEPLOYMENT_TARGET: '10.9' + PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib with: - args: -i python --release --universal2 --out dist --no-sdist + args: -i python${{ matrix.python.version }} --release --universal2 --out dist --no-sdist - name: Show wheels generated run: ls -lh dist/ - name: Upload wheels diff --git a/.gitignore b/.gitignore index 3c24b98..ede163c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # rust -/target -/demo/target +target/ +demo/target/ # python -/dist +dist/ +env/ From 862ff784f68ca71e68026c903265992baaef4b5b Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 3 Dec 2021 13:45:27 -0500 Subject: [PATCH 05/14] only build sdist once --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3022e98..237d32e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: uses: messense/maturin-action@v1 with: target: x86_64 - args: --release --out dist + args: -i python${{ matrix.python.version }} --release --out dist ${{ matrix.python-version != 3.9 && '--no-sdist' }} - name: Build wheels - universal2 uses: messense/maturin-action@v1 env: @@ -39,7 +39,7 @@ jobs: # MACOSX_DEPLOYMENT_TARGET: '10.9' PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib with: - args: -i python${{ matrix.python.version }} --release --universal2 --out dist --no-sdist + args: -i python${{ matrix.python.version }} --release --universal2 --out dist --no-sdist - name: Show wheels generated run: ls -lh dist/ - name: Upload wheels From 5ce5b424f8077f1f2f0d1b2e11803653397d12cc Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 3 Dec 2021 13:48:59 -0500 Subject: [PATCH 06/14] fix arg --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 237d32e..2fac290 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: uses: messense/maturin-action@v1 with: target: x86_64 - args: -i python${{ matrix.python.version }} --release --out dist ${{ matrix.python-version != 3.9 && '--no-sdist' }} + args: -i python${{ matrix.python.version }} --release --out dist ${{ matrix.python-version != 3.9 && '--no-sdist' || '' }} - name: Build wheels - universal2 uses: messense/maturin-action@v1 env: From 39868d50ae0b07fd240cee4da72660c7a9ae56e2 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 3 Dec 2021 13:53:52 -0500 Subject: [PATCH 07/14] use explicit python version --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fac290..fc07bf2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: uses: messense/maturin-action@v1 with: target: x86_64 - args: -i python${{ matrix.python.version }} --release --out dist ${{ matrix.python-version != 3.9 && '--no-sdist' || '' }} + args: -i python${{ matrix.python-version }} --release --out dist ${{ matrix.python-version != 3.9 && '--no-sdist' || '' }} - name: Build wheels - universal2 uses: messense/maturin-action@v1 env: @@ -39,7 +39,7 @@ jobs: # MACOSX_DEPLOYMENT_TARGET: '10.9' PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib with: - args: -i python${{ matrix.python.version }} --release --universal2 --out dist --no-sdist + args: -i python${{ matrix.python-version }} --release --universal2 --out dist --no-sdist - name: Show wheels generated run: ls -lh dist/ - name: Upload wheels From 5a9d121de335d2a13315ad6dbc201eac5d5539fd Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Fri, 3 Dec 2021 14:00:13 -0500 Subject: [PATCH 08/14] cleanup --- .github/workflows/release.yml | 49 ++++++++++++++++------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc07bf2..921fef9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ on: description: "Publish to PyPI (true/false)" required: true default: "false" - pull_request: jobs: python-macos: @@ -35,8 +34,6 @@ jobs: - name: Build wheels - universal2 uses: messense/maturin-action@v1 env: - # DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer - # MACOSX_DEPLOYMENT_TARGET: '10.9' PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib with: args: -i python${{ matrix.python-version }} --release --universal2 --out dist --no-sdist @@ -182,26 +179,26 @@ jobs: name: wheels path: dist - # publish: - # needs: [python-macos, python-windows, python-linux, python-linux-cross] - # name: Publish to PyPI - # environment: - # name: pypi-prod - # runs-on: ubuntu-latest - # if: ${{ github.event.inputs.publish == 'true' }} - # steps: - # - uses: actions/download-artifact@v2 - # with: - # name: wheels - # - name: Show wheels generated - # run: ls -lh ./ - # - uses: actions/setup-python@v2 - # with: - # python-version: 3.9 - # - name: Publish to PyPi - # env: - # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - # run: | - # pip install --upgrade twine - # twine upload --skip-existing * + publish: + needs: [python-macos, python-windows, python-linux, python-linux-cross] + name: Publish to PyPI + environment: + name: pypi-prod + runs-on: ubuntu-latest + if: ${{ github.event.inputs.publish == 'true' }} + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + - name: Show wheels generated + run: ls -lh ./ + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Publish to PyPi + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + pip install --upgrade twine + twine upload --skip-existing * From 411b78967ca943cedef7c2c189a852f79b9fbd92 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 6 Dec 2021 11:53:39 -0500 Subject: [PATCH 09/14] test py3.10 --- .github/workflows/release.yml | 53 ++++++----------------------------- 1 file changed, 9 insertions(+), 44 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 921fef9..107a0bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: description: "Publish to PyPI (true/false)" required: true default: "false" + pull_request: jobs: python-macos: @@ -14,23 +15,17 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true - name: Build wheels - x86_64 uses: messense/maturin-action@v1 with: target: x86_64 - args: -i python${{ matrix.python-version }} --release --out dist ${{ matrix.python-version != 3.9 && '--no-sdist' || '' }} + args: -i python${{ matrix.python-version }} --release --out dist ${{ matrix.python-version != '3.9' && '--no-sdist' || '' }} - name: Build wheels - universal2 uses: messense/maturin-action@v1 env: @@ -46,44 +41,23 @@ jobs: path: dist python-windows: - name: Build windows ${{ matrix.target }} + name: Build windows ${{ matrix.target }} py${{ matrix.python-version }} runs-on: windows-latest strategy: matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] target: [x64, x86] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.9 - architecture: ${{ matrix.target }} - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - architecture: ${{ matrix.target }} - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - architecture: ${{ matrix.target }} - - uses: actions/setup-python@v2 - with: - python-version: 3.6 + python-version: ${{ matrix.python-version }} architecture: ${{ matrix.target }} - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true - name: Build wheels uses: messense/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --no-sdist - - name: Install built wheel - run: | - pip install dbt_extractor --no-index --find-links dist --force-reinstall - python -c "import dbt_extractor" + args: -i python --release --out dist --no-sdist - name: Show wheels generated run: ls -lh dist shell: bash @@ -101,10 +75,7 @@ jobs: target: [x86_64, i686] steps: - uses: actions/checkout@v2 - # the native python is only used to test that the package can be installed - uses: actions/setup-python@v2 - with: - python-version: 3.9 # supported python versions # https://github.com/messense/maturin-action/blob/51478586be5dfb16a569cb6bbec182fba9f13f79/src/index.ts#L245 - name: Build Wheels @@ -113,11 +84,6 @@ jobs: target: ${{ matrix.target }} manylinux: auto args: --release --out dist --no-sdist - - name: Install built wheel - if: matrix.target == 'x86_64' - run: | - pip install dbt_extractor --no-index --find-links dist --force-reinstall - python -c "import dbt_extractor" - name: Show wheels generated run: ls -lh dist/ - name: Upload wheels @@ -143,6 +109,7 @@ jobs: PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib steps: - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 - name: Build Wheels uses: messense/maturin-action@v1 with: @@ -164,7 +131,7 @@ jobs: apt-get install -y --no-install-recommends python3 python3-pip software-properties-common add-apt-repository ppa:deadsnakes/ppa apt-get update - apt-get install -y python3.6 python3.7 python3.9 + apt-get install -y python3.6 python3.7 python3.8 python3.9 run: | ls -lrth /artifacts PYTHON=python${{ matrix.python.version }} @@ -193,8 +160,6 @@ jobs: - name: Show wheels generated run: ls -lh ./ - uses: actions/setup-python@v2 - with: - python-version: 3.9 - name: Publish to PyPi env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} From 6f5c01859c40466242d73c47547b4bf672cfe100 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 6 Dec 2021 13:17:50 -0500 Subject: [PATCH 10/14] show generated wheels in last step --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 107a0bc..62826b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -152,7 +152,6 @@ jobs: environment: name: pypi-prod runs-on: ubuntu-latest - if: ${{ github.event.inputs.publish == 'true' }} steps: - uses: actions/download-artifact@v2 with: @@ -161,6 +160,7 @@ jobs: run: ls -lh ./ - uses: actions/setup-python@v2 - name: Publish to PyPi + if: ${{ github.event.inputs.publish == 'true' }} env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} From b6efb4784e9129b3ca5b2f1ea4478c1708de1d2b Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 6 Dec 2021 13:30:27 -0500 Subject: [PATCH 11/14] rm PR trigger --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62826b2..fcd5062 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ on: description: "Publish to PyPI (true/false)" required: true default: "false" - pull_request: jobs: python-macos: From 6a5e45a129db0a732cd17e2547c81c81f5b32e83 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 6 Dec 2021 13:56:21 -0500 Subject: [PATCH 12/14] add comments --- .github/workflows/release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcd5062..a7d462b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,11 +20,14 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + # This step runs on the GHA vm + # Exclude the `--no-sdist` arg for at least 1 python version, no need to build it for each python version - name: Build wheels - x86_64 uses: messense/maturin-action@v1 with: target: x86_64 args: -i python${{ matrix.python-version }} --release --out dist ${{ matrix.python-version != '3.9' && '--no-sdist' || '' }} + # This step runs on the GHA vm - name: Build wheels - universal2 uses: messense/maturin-action@v1 env: @@ -52,6 +55,7 @@ jobs: with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.target }} + # This step runs on the GHA vm - name: Build wheels uses: messense/maturin-action@v1 with: @@ -74,9 +78,10 @@ jobs: target: [x86_64, i686] steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 # supported python versions # https://github.com/messense/maturin-action/blob/51478586be5dfb16a569cb6bbec182fba9f13f79/src/index.ts#L245 + # this step runs in a docker container selected by the messense/maturin-action action + # there is no need to install python on the GHA vm - name: Build Wheels uses: messense/maturin-action@v1 with: @@ -108,7 +113,8 @@ jobs: PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + # this step runs in a docker container selected by the messense/maturin-action action + # there is no need to install python on the GHA vm - name: Build Wheels uses: messense/maturin-action@v1 with: From f23f9904b497a2677ebdc90709a483806f1400e9 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 6 Dec 2021 13:56:42 -0500 Subject: [PATCH 13/14] test --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7d462b..256ed95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: description: "Publish to PyPI (true/false)" required: true default: "false" + pull_request: jobs: python-macos: From 9b37f70dbac61f78b2f9ea796982b21042c9eb45 Mon Sep 17 00:00:00 2001 From: Kyle Wigley Date: Mon, 6 Dec 2021 14:42:29 -0500 Subject: [PATCH 14/14] rm PR trigger --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 256ed95..a7d462b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ on: description: "Publish to PyPI (true/false)" required: true default: "false" - pull_request: jobs: python-macos: