From db2412ca4563f3111ec56b829322478a37b747f2 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Thu, 26 Sep 2024 16:30:28 +0530 Subject: [PATCH] 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