HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/platform/gsutil/third_party/httplib2/.github/workflows/publish.yaml
name: publish
on:
  # on pull request, run build step to catch errors earlier, but do not publish
  pull_request:
  # on push to master without a version tag, publish to test PyPI registry
  # ... with version tag, publish to production PyPI registry.
  push:
    branches: [master]
    tags: ["v[0-9]*"]
jobs:
  build:
    # https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012/5
    if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'httplib2/httplib2' }}
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
      - uses: actions/checkout@v2

      - name: cache pip
        uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-publish
          restore-keys: |
            ${{ runner.os }}-pip-
            ${{ runner.os }}-

      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.x
      - name: install tools
        run: pip install --upgrade build check-manifest setuptools twine wheel

      - name: build package
        run: python -m build
      - name: check manifest
        run: check-manifest
      - name: twine check
        run: twine check dist/*

      - uses: actions/upload-artifact@v2
        with:
          name: dist
          path: dist/
          if-no-files-found: error
          retention-days: 1

  publish-prod:
    if: ${{ github.repository == 'httplib2/httplib2' && startsWith(github.ref, 'refs/tags/') }}
    needs: [build]
    environment: pypi-public
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
      - name: cache pip
        uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-publish
          restore-keys: |
            ${{ runner.os }}-pip-

      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.x
      - name: install tools
        run: pip install twine

      - uses: actions/download-artifact@v2
        with:
          name: dist
          path: dist/

      - name: twine check
        run: twine check dist/*

      - name: twine upload (prod)
        if: startsWith(github.ref, 'refs/tags/')
        env:
          TWINE_USERNAME: "__token__"
          TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
        run: twine upload --non-interactive --verbose dist/*

  publish-test:
    if: ${{ github.repository == 'httplib2/httplib2' && github.ref == 'refs/heads/master' }}
    needs: [build]
    environment: pypi-test
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
      - name: cache pip
        uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-publish
          restore-keys: |
            ${{ runner.os }}-pip-

      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.x
      - name: install tools
        run: pip install twine

      - uses: actions/download-artifact@v2
        with:
          name: dist
          path: dist/

      - name: twine upload (test)
        if: github.ref == 'refs/heads/master'
        env:
          TWINE_USERNAME: "__token__"
          TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
          TWINE_REPOSITORY: "testpypi"
        run: echo twine upload --non-interactive --skip-existing --verbose dist/*