Skip to content

Commit

Permalink
Adds documentation publishing to package release
Browse files Browse the repository at this point in the history
  • Loading branch information
erikhuck committed Apr 19, 2024
1 parent b62943a commit d45ff55
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 29 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
fetch-tags: true
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
- name: Upgrade pip, install package, install requirements, build docs
run: |
pip install --upgrade pip
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/package_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,24 @@ jobs:
with:
repository_url: https://test.pypi.org/legacy/
secrets:
PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
test-test-pypi:
needs: [release-version, publish-test-pypi]
uses: ./.github/workflows/tests.yml
with:
install_command: "python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple gpu-tracker==${{ needs.release-version.outputs.version }}"

# - name: Publish package to PyPi
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
publish-pypi:
needs: test-test-pypi
uses: ./.github/workflows/pypi.yml
with:
repository_url: https://upload.pypi.org/legacy/
secrets:
API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
test-pypi:
needs: [release-version, publish-pypi]
uses: ./.github/workflows/tests.yml
with:
install_command: "python3 -m pip install gpu-tracker==${{ needs.release-version.outputs.version }}"
publish-documentation:
needs: test-pypi
uses: ./.github/workflows/documentation.yml
19 changes: 3 additions & 16 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@ on:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ ubuntu-latest, windows-latest, macOS-latest ]
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
pull-request:
uses: ./.github/workflows/tests.yml
with:
python-version: ${{ matrix.python-version }}
- name: Install testing environment and gpu-tracker package
run: bash tests/install.sh
- name: Test with pytest
run: bash tests/run.sh
install_command: "python3 -m pip install -e ."
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
type: string
secrets:
PYPI_API_TOKEN:
API_TOKEN:
required: true

jobs:
Expand All @@ -28,5 +28,5 @@ jobs:
- name: Publish package to a PyPi distribution
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.API_TOKEN }}
repository-url: ${{ inputs.repository_url }}

0 comments on commit d45ff55

Please sign in to comment.