Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
Update all actions and adopt our custom composite actions for running
tox and publishing to PyPI. Still using the local ltd-conveyor to test
uploading.
  • Loading branch information
jonathansick committed Feb 22, 2024
1 parent 9622fbd commit 901f2d1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 43 deletions.
54 changes: 23 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,49 @@ 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
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "docs"

- name: Install LTD Conveyor for upload
run: pip install .

- name: Upload to LSST the Docs
- name: Upload to LSST the docs
if: ${{ github.event_name == 'push' }}
env:
LTD_USERNAME: ${{ secrets.LTD_USERNAME }}
Expand All @@ -68,29 +67,22 @@ jobs:

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"
23 changes: 11 additions & 12 deletions .github/workflows/cron-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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"

0 comments on commit 901f2d1

Please sign in to comment.