diff --git a/.github/deploy.yml b/.github/deploy.yml deleted file mode 100644 index 29c7cc3636..0000000000 --- a/.github/deploy.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Test and Deploy to PyPI - -on: - release: - types: [published] - workflow_dispatch: - -env: - ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} - -jobs: - test: - name: Test - Python ${{ matrix.python-version }} - runs-on: ${{ github.repository_owner == 'twilio-internal' && 'ubuntu-x64' || 'ubuntu-latest' }} - timeout-minutes: 20 - permissions: - contents: read - id-token: write - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - with: - fetch-depth: 0 - - - name: Authenticate with Artifactory - uses: ./.github/actions/artifactory-oidc - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install virtualenv --upgrade - make install test-install - - - name: Run tests - run: make test-with-coverage - - deploy: - name: Publish to PyPI - needs: [test] - runs-on: ${{ github.repository_owner == 'twilio-internal' && 'ubuntu-x64' || 'ubuntu-latest' }} - environment: pypi - permissions: - contents: read - id-token: write - attestations: write - steps: - - uses: actions/checkout@v4 - - - name: Authenticate with Artifactory - uses: ./.github/actions/artifactory-oidc - - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Validate tag matches package version - run: | - TAG="${GITHUB_REF#refs/tags/}" - # Strip leading 'v' if present - VERSION="${TAG#v}" - PKG_VERSION=$(python setup.py --version) - if [ "$VERSION" != "$PKG_VERSION" ]; then - echo "::error::Tag $TAG does not match setup.py version $PKG_VERSION" - exit 1 - fi - - - name: Build package - run: | - pip install build - python -m build - - - name: Verify package - run: | - pip install twine - twine check dist/* - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 29808ad2cb..e69de29bb2 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -1,90 +0,0 @@ -name: Test Release (Dry Run) - -on: - workflow_dispatch: - inputs: - python-version: - description: "Python version to test with (or 'all' for full matrix)" - required: false - default: "3.12" - -env: - ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} - -jobs: - test: - name: Test - Python ${{ matrix.python-version }} - runs-on: ${{ github.repository_owner == 'twilio-internal' && 'ubuntu-x64' || 'ubuntu-latest' }} - timeout-minutes: 20 - permissions: - contents: read - id-token: write - strategy: - fail-fast: false - matrix: - python-version: ${{ github.event.inputs.python-version == 'all' && fromJson('["3.8","3.9","3.10","3.11","3.12","3.13"]') || fromJson(format('["{0}"]', github.event.inputs.python-version)) }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Authenticate with Artifactory - uses: ./.github/actions/artifactory-oidc - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install virtualenv --upgrade - make install test-install - - - name: Run tests - run: make test-with-coverage - - deploy-dry-run: - name: Deploy (Dry Run - No Publish) - needs: [test] - runs-on: ${{ github.repository_owner == 'twilio-internal' && 'ubuntu-x64' || 'ubuntu-latest' }} - environment: pypi - permissions: - contents: read - id-token: write - attestations: write - steps: - - uses: actions/checkout@v4 - - - name: Authenticate with Artifactory - uses: ./.github/actions/artifactory-oidc - - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Validate version in setup.py - run: | - PKG_VERSION=$(python setup.py --version) - echo "Package version: $PKG_VERSION" - echo "PKG_VERSION=$PKG_VERSION" >> "$GITHUB_ENV" - - - name: Build package - run: | - pip install build - python -m build - - - name: Verify package - run: | - pip install twine - twine check dist/* - - - name: List built artifacts - run: | - echo "Built artifacts:" - ls -lh dist/ - echo "" - echo "Package version: $PKG_VERSION" - echo "" - echo "--- DRY RUN COMPLETE ---" - echo "To publish for real, create a GitHub Release with a matching tag" - echo "and use the deploy.yml workflow."