From c8ee60c7bb4978ff54cde39146a43f8de116056d Mon Sep 17 00:00:00 2001 From: Two Dev Date: Sun, 15 Dec 2024 13:23:14 +0700 Subject: [PATCH] chore: test pypi --- .github/workflows/ci.yml | 68 ----------------------------------- .github/workflows/publish.yml | 38 +++++++++----------- 2 files changed, 17 insertions(+), 89 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 819436d..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: CI - -on: - pull_request: - branches: ['master', 'main', 'dev', 'develop'] - -jobs: - build-on-ubuntu: - runs-on: ubuntu-latest - strategy: - fail-fast: false - max-parallel: 3 - matrix: - python-version: ['3.9', '3.10', '3.11'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Dependencies, Lint and Tests - run: | - make init-actions - - build-on-mac: - runs-on: macos-latest - strategy: - fail-fast: false - max-parallel: 1 - matrix: - python-version: ['3.9'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Dependencies, Lint and Tests - run: | - make init-actions - - - name: Pytest - run: | - make pytest - - build-on-windows: - runs-on: windows-latest - strategy: - fail-fast: false - max-parallel: 1 - matrix: - python-version: ['3.9'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Dependencies, Lint - run: | - make init-actions - - - name: Pytest - run: | - make pytest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4761494..328beea 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,30 +1,26 @@ name: Upload Python Package on: - release: - types: [created] + pull_request: + branches: ['master', 'main'] jobs: deploy: name: Publish PyPI runs-on: ubuntu-latest - permissions: - id-token: write steps: - - uses: actions/checkout@master - - name: Set up Python 3.9 - uses: actions/setup-python@v3 - with: - python-version: '3.9' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build a binary wheel - run: >- - python setup.py sdist bdist_wheel - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} - skip-existing: true + - uses: actions/checkout@main + - name: Set up Python 3.9 + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Build package + run: | + python -m pip install -U pip build setuptools twine + - name: Publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload --repository testpypi --skip-existing dist/*