Skip to content

Commit

Permalink
Fixed GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Dec 14, 2024
1 parent 2b7c905 commit 86a0a3b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 30 deletions.
9 changes: 0 additions & 9 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
name: Release
description: Create a GitHub release and upload the package to PyPI
inputs:
pypi-api-token:
description: 'PyPI API token'
required: true
tag-name:
description: 'The name of the tag for the GitHub release'
required: true
github-token:
description: 'GitHub token'
required: true

runs:
using: "composite"
Expand All @@ -31,9 +25,6 @@ runs:
files: dist/*
tag_name: "${{ inputs.tag-name }}"
body_path: release-notes.md
token: ${{ inputs.github-token }}

- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ inputs.pypi-api-token }}
12 changes: 7 additions & 5 deletions .github/actions/setup-python-and-git/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ inputs:
python-version:
description: 'Python version to use'
required: false
default: '3.11'
default: '3.12'
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Setup Python
with:
python-version: ${{ inputs.python-version }}
cache: 'pip' # caching pip dependencies

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Git check
run: |
git config --global user.email "bump-my-version@github.actions"
git config --global user.email "action@github.actions"
git config --global user.name "Testing Git"
git --version
git config --list
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/docs-final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}

- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Setup Python and Git
uses: ./.github/actions/setup-python-and-git
with:
python-version: "3.10"
python-version: '3.12'

- name: Install dependencies
run: |
git pull --all
python -m pip install ".[docs]"
uv sync -p 3.12 --group docs
- name: Build and deploy documentation
run: |
mkdocs gh-deploy --strict -v
uv run mkdocs gh-deploy --strict
11 changes: 5 additions & 6 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Setup Python and Git
uses: ./.github/actions/setup-python-and-git
with:
python-version: "3.10"
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install ".[docs]"
run: uv sync -p 3.12 --group docs

- name: Build documentation
run: |
mkdocs build --strict -v
uv run mkdocs build --strict
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,3 @@ jobs:
uses: ./.github/actions/release
with:
tag-name: ${{ env.TAG_NAME }}
github-token: ${{ secrets.PAT }}
pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ jobs:
run: |
echo -e '[ui]\nusername = Testing Mercurial<[email protected]>' > ~/.hgrc
hg --version
- name: Install test dependencies
run: pip install '.[test]'
- name: Install requirements
shell: bash
run: |
uv sync -p 3.12 --group dev
- name: Test
run: pytest --cov-report=xml
- name: Upload coverage to Codecov
Expand Down

0 comments on commit 86a0a3b

Please sign in to comment.