Skip to content

Commit

Permalink
reverting
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf Khan authored and Yusuf Khan committed Sep 8, 2023
1 parent d8d412c commit 91ec741
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 280 deletions.
84 changes: 42 additions & 42 deletions .github/workflows/build-apple-silicon.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
# name: Build and Publish for Apple Silicon
name: Build and Publish for Apple Silicon

# on:
# push:
# branches:
# - main
# pull_request:
# types:
# - closed
on:
push:
branches:
- main
pull_request:
types:
- closed

# jobs:
# build_wheels_macos:
# name: Build wheels on macos-11
# runs-on: macos-11
# steps:
# - uses: actions/checkout@v3
jobs:
build_wheels_macos:
name: Build wheels on macos-11
runs-on: macos-11
steps:
- uses: actions/checkout@v3

# - name: Build wheels
# uses: pypa/cibuildwheel@v2.13.0
# env:
# CIBW_ARCHS_MACOS: x86_64 arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.13.0
env:
CIBW_ARCHS_MACOS: x86_64 arm64

# - uses: actions/upload-artifact@v3
# with:
# path: ./wheelhouse/*.whl
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

# upload_pypi:
# needs: build_wheels_macos
# runs-on: ubuntu-latest
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# steps:
# - name: Download wheels
# uses: actions/download-artifact@v2
# with:
# name: artifact
# path: dist/
upload_pypi:
needs: build_wheels_macos
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: artifact
path: dist/

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.9
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

# - name: Install twine
# run: python -m pip install twine
- name: Install twine
run: python -m pip install twine

# - name: Publish wheels to PyPI
# run: twine upload --skip-existing --repository-url https://upload.pypi.org/legacy/ dist/*.whl
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- name: Publish wheels to PyPI
run: twine upload --skip-existing --repository-url https://upload.pypi.org/legacy/ dist/*.whl
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
76 changes: 0 additions & 76 deletions .github/workflows/build-linux.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/build-win-mac.yml

This file was deleted.

53 changes: 29 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Build and Publish Source Distribution
name: Build and Publish Mac and Windows

on:
push:
branches:
- main
- develop
pull_request:
types:
- closed

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]

steps:
- name: Checkout code
Expand All @@ -23,28 +25,35 @@ jobs:
with:
python-version: 3.8

- name: Build sdist
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Build wheel
run: |
pip install wheel
python setup.py sdist
mkdir -p dists
mv dist/*.tar.gz dists/
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp38-*

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: sdist
path: ./dists/*.tar.gz
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

upload_sdist:
needs: build_sdist
upload_wheels:
needs: build_wheels
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
if: github.event.pull_request.merged == true || github.ref == 'refs/heads/main'
steps:
- name: Download sdist
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: wheels-windows-latest
path: dist/
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: sdist
name: wheels-macos-latest
path: dist/

- name: Set up Python 3.8
Expand All @@ -55,13 +64,9 @@ jobs:
- name: Install twine
run: python -m pip install twine

- name: Publish sdist to PyPI
- name: Publish wheels to PyPI
run: |
if [ "${{ github.ref }}" = "refs/heads/develop" ]; then
twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*.tar.gz
else
twine upload --skip-existing --repository-url https://upload.pypi.org/legacy/ dist/*.tar.gz
fi
twine upload --skip-existing --repository-url https://upload.pypi.org/legacy/ dist/*.whl
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
# Mark us as not a pure python package
self.root_is_pure = False

def get_tag(self):
python, abi, plat = _bdist_wheel.get_tag(self)
# We don't contain any python source
python, abi = 'py2.py3', 'none'
return python, abi, plat

Expand All @@ -19,6 +21,7 @@ class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
install.run(self)
# RUN CUSTOM POST-INSTALL SCRIPT HERE
setup_dir = os.path.dirname(os.path.realpath(__file__))
post_install_script = os.path.join(setup_dir, 'setup', 'post_install.py')
os.system(f"python {post_install_script}")
Expand All @@ -28,7 +31,7 @@ def run(self):

setup(
name="azpype",
version="0.3.8",
version="0.3.9",
description="A native Python interface wrapping AzCopy for bulk data transfer to and from Azure Blob Storage.",
long_description=open('README.md', encoding="UTF-8").read(),
long_description_content_type='text/markdown',
Expand Down
Loading

0 comments on commit 91ec741

Please sign in to comment.