diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5a802ba..6eb77b4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,81 +16,72 @@ jobs: - "3.12" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # full depth for setuptools_scm - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install tox - run: pip install tox - - name: Run tox + uses: lsst-sqre/run-tox@v1 + with: + python-version: ${{ matrix.python }} + tox-envs: "lint,typing,py" env: LTD_TEST_AWS_ID: ${{ secrets.LTD_TEST_AWS_ID }} LTD_TEST_AWS_SECRET: ${{ secrets.LTD_TEST_AWS_SECRET }} LTD_TEST_BUCKET: ${{ secrets.LTD_TEST_BUCKET }} - run: tox -e py,lint,typing # run tox using Python in path docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # full depth for setuptools_scm - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.9" - - name: Install tox and - run: | - pip install tox - - name: Run tox - run: tox -e docs - - - name: Install LTD Conveyor for upload - run: pip install . + uses: lsst-sqre/run-tox@v1 + with: + python-version: ${{ matrix.python }} + tox-envs: "docs" - - name: Upload to LSST the Docs + - name: Upload documentation + uses: lsst-sqre/ltd-upload@v1 if: ${{ github.event_name == 'push' }} - env: - LTD_USERNAME: ${{ secrets.LTD_USERNAME }} - LTD_PASSWORD: ${{ secrets.LTD_PASSWORD }} - run: ltd upload --product ltd-conveyor --gh --dir docs/_build/html + with: + project: "ltd-conveyor" + dir: "docs/_build/html" + username: ${{ secrets.ltd_username }} + password: ${{ secrets.ltd_password }} pypi: + name: Upload release to PyPI runs-on: ubuntu-latest needs: [test, docs] if: startsWith(github.ref, 'refs/tags/') + environment: + name: pypi + url: https://pypi.org/p/ltd-conveyor + permissions: + id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # full depth for setuptools_scm - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: "__token__" - TWINE_PASSWORD: ${{ secrets.PYPI_SQRE_ADMIN }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + uses: lsst-sqre/build-and-publish-to-pypi@v2 + with: + python-version: "3.11" diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index 3ed8971..c9d6ecf 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -21,24 +21,24 @@ jobs: - "3.12" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # full depth for setuptools_scm - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install tox - run: pip install tox - - name: Run tox + uses: lsst-sqre/run-tox@v1 + with: + python-version: ${{ matrix.python }} + tox-envs: "lint,typing,py" env: LTD_TEST_AWS_ID: ${{ secrets.LTD_TEST_AWS_ID }} LTD_TEST_AWS_SECRET: ${{ secrets.LTD_TEST_AWS_SECRET }} LTD_TEST_BUCKET: ${{ secrets.LTD_TEST_BUCKET }} - run: tox -e py,lint,typing # run tox using Python in path docs: @@ -50,13 +50,12 @@ jobs: fetch-depth: 0 # full depth for setuptools_scm - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.9" - - name: Install tox and LTD Conveyor - run: | - pip install tox - - name: Run tox - run: tox -e docs + uses: lsst-sqre/run-tox@v1 + with: + python-version: ${{ matrix.python }} + tox-envs: "docs"