From 553c0ab560692e5a41ffdb117457a01ca99ce4b1 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 15:52:48 +0530 Subject: [PATCH 1/7] Adds Deploy step --- .github/workflows/build-test-lint.yml | 52 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 14acf9c..569a696 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -2,6 +2,8 @@ name: Python Build, Lint on: push: + release: + types: [published] jobs: build-test-lint: @@ -16,7 +18,7 @@ jobs: - name: Set up Python environment uses: actions/setup-python@v5 - with: + with: python-version: '3.8' cache: 'pip' @@ -29,11 +31,11 @@ jobs: sudo pip install flake8 pip install -r requirements.txt -r requirements/dev.txt working-directory: xero-python - + - name: Run Flake8 run: flake8 xero_python working-directory: xero-python - + - name: Build package run: python setup.py sdist working-directory: xero-python @@ -43,4 +45,46 @@ jobs: # source venv/bin/activate # pip install -r requirements/test.txt # pytest -v - # working-directory: xero-python \ No newline at end of file + # working-directory: xero-python + deploy: + runs-on: ubuntu-latest + needs: build-test-lint + if: github.event_name == 'release' && github.event.action == 'published' + + steps: + - name: Checkout xero-python repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/xero-python + path: xero-python + + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: '3.8' + cache: 'pip' + + - name: Install dependencies + run: | + python -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install black + sudo pip install flake8 + pip install -r requirements.txt -r requirements/dev.txt + working-directory: xero-python + + - name: Build new package version + run: python setup.py sdist + working-directory: xero-python + + - name: Verify new package version + run: ls -al dist + working-directory: xero-python + + - name: Deploy to test PyPi + env: + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* + working-directory: xero-python From db2412ca4563f3111ec56b829322478a37b747f2 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 16:30:28 +0530 Subject: [PATCH 2/7] adds a separate deploy step --- .github/workflows/build-test-lint.yml | 44 -------------------------- .github/workflows/deploy.yml | 45 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 569a696..fdef614 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -2,8 +2,6 @@ name: Python Build, Lint on: push: - release: - types: [published] jobs: build-test-lint: @@ -46,45 +44,3 @@ jobs: # pip install -r requirements/test.txt # pytest -v # working-directory: xero-python - deploy: - runs-on: ubuntu-latest - needs: build-test-lint - if: github.event_name == 'release' && github.event.action == 'published' - - steps: - - name: Checkout xero-python repo - uses: actions/checkout@v4 - with: - repository: XeroAPI/xero-python - path: xero-python - - - name: Set up Python environment - uses: actions/setup-python@v5 - with: - python-version: '3.8' - cache: 'pip' - - - name: Install dependencies - run: | - python -m venv venv - source venv/bin/activate - pip install --upgrade pip - pip install black - sudo pip install flake8 - pip install -r requirements.txt -r requirements/dev.txt - working-directory: xero-python - - - name: Build new package version - run: python setup.py sdist - working-directory: xero-python - - - name: Verify new package version - run: ls -al dist - working-directory: xero-python - - - name: Deploy to test PyPi - env: - TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* - working-directory: xero-python diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..597e6a6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Deploy +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout xero-python repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/xero-python + path: xero-python + + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: '3.8' + cache: 'pip' + + - name: Install dependencies + run: | + python -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install black + sudo pip install flake8 + pip install -r requirements.txt -r requirements/dev.txt + working-directory: xero-python + + - name: Build new package version + run: python setup.py sdist + working-directory: xero-python + + - name: Verify new package version + run: ls -al dist + working-directory: xero-python + + - name: Deploy to test PyPi + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} + run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* + working-directory: xero-python From 08fa57b18ab597369ed3793494fdbf90a3acc7b3 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 16:38:21 +0530 Subject: [PATCH 3/7] install twine --- .github/workflows/deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 597e6a6..fbc6d4f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,8 +24,7 @@ jobs: python -m venv venv source venv/bin/activate pip install --upgrade pip - pip install black - sudo pip install flake8 + sudo pip install twine pip install -r requirements.txt -r requirements/dev.txt working-directory: xero-python From 61d93700cbca39105061f9de322f69dadb347784 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 16:41:55 +0530 Subject: [PATCH 4/7] update to correct alpha version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c85f5e4..11f0ad7 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,5 @@ def read_file(filename): keywords="xero python sdk API oAuth", name="xero_python", packages=find_packages(include=["xero_python", "xero_python.*"]), - version="6.3.0", + version="6.3.0-alpha.3", ) From 83274120b5cb3d82f538c965a279beeb85aef8f9 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 16:49:36 +0530 Subject: [PATCH 5/7] removed some unused steps --- .github/workflows/deploy.yml | 5 ----- setup.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fbc6d4f..f7e77e8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,17 +25,12 @@ jobs: source venv/bin/activate pip install --upgrade pip sudo pip install twine - pip install -r requirements.txt -r requirements/dev.txt working-directory: xero-python - name: Build new package version run: python setup.py sdist working-directory: xero-python - - name: Verify new package version - run: ls -al dist - working-directory: xero-python - - name: Deploy to test PyPi env: TWINE_USERNAME: __token__ diff --git a/setup.py b/setup.py index 11f0ad7..e4c14e8 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,5 @@ def read_file(filename): keywords="xero python sdk API oAuth", name="xero_python", packages=find_packages(include=["xero_python", "xero_python.*"]), - version="6.3.0-alpha.3", + version="6.3.0-alpha.4", ) From e119bd210cfca9a7d192d559c8c860d05753f446 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 16:52:35 +0530 Subject: [PATCH 6/7] final commit with test instance --- .github/workflows/deploy.yml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f7e77e8..dfc7986 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,11 +27,11 @@ jobs: sudo pip install twine working-directory: xero-python - - name: Build new package version + - name: Build Package run: python setup.py sdist working-directory: xero-python - - name: Deploy to test PyPi + - name: Deploy to PyPi env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} diff --git a/setup.py b/setup.py index e4c14e8..c85f5e4 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,5 @@ def read_file(filename): keywords="xero python sdk API oAuth", name="xero_python", packages=find_packages(include=["xero_python", "xero_python.*"]), - version="6.3.0-alpha.4", + version="6.3.0", ) From e718f32b45be18706d9e2ce38ead0be11a2dfb15 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 17:28:21 +0530 Subject: [PATCH 7/7] fixed review comments - corrected name from deploy to publish --- .github/workflows/{deploy.yml => publish.yml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{deploy.yml => publish.yml} (94%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/publish.yml similarity index 94% rename from .github/workflows/deploy.yml rename to .github/workflows/publish.yml index dfc7986..8d4bd87 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,10 @@ -name: Deploy +name: Publish on: release: types: [published] jobs: - deploy: + publish: runs-on: ubuntu-latest steps: - name: Checkout xero-python repo @@ -31,7 +31,7 @@ jobs: run: python setup.py sdist working-directory: xero-python - - name: Deploy to PyPi + - name: Publish to PyPi env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}