diff --git a/.github/actions/release/action.yaml b/.github/actions/release/action.yaml index 649bb60..343ac2e 100644 --- a/.github/actions/release/action.yaml +++ b/.github/actions/release/action.yaml @@ -31,9 +31,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 }} diff --git a/.github/actions/setup-python-and-git/action.yaml b/.github/actions/setup-python-and-git/action.yaml index 44b7247..fd3675a 100644 --- a/.github/actions/setup-python-and-git/action.yaml +++ b/.github/actions/setup-python-and-git/action.yaml @@ -4,16 +4,19 @@ 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@v3 + with: + version: "latest" - name: Git check run: | git config --global user.email "action@github.actions" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index def335a..7c2b6e0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,6 @@ jobs: name: Checkout the repository with: fetch-depth: 0 - token: ${{ secrets.PAT }} - name: Setup Python and Git uses: ./.github/actions/setup-python-and-git @@ -43,8 +42,6 @@ jobs: echo "pull_request_number=${PR_NUMBER}" >> $GITHUB_OUTPUT echo "::notice::PR_NUMBER is ${PR_NUMBER}" echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - name: Bump version if: ${{ env.RELEASE_KIND != 'no-release' }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4662249..a6e977e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,56 +22,42 @@ jobs: - ubuntu-latest - windows-latest python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - "3.12" + - "3.13" runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v4 + name: Checkout the repository + with: + fetch-depth: 0 - uses: ./.github/actions/setup-python-and-git with: python-version: ${{ matrix.python-version }} - - name: Check git is working - run: | - git config --global user.email "test-git@github.actions" - git config --global user.name "Testing Git" - git --version - git config --list - name: Install test dependencies - run: pip install '.[test]' + run: uv sync -p ${{ matrix.python-version }} --group test - name: Test - run: coverage -m pytest && coverage xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: test-reports/coverage.xml - flags: python-${{ matrix.python-version }} - verbose: true # optional (default = false) - env_vars: OS,PYTHON + run: uv run pytest # Upload to Test PyPI. release-test-pypi: name: Publish in-dev package to test.pypi.org runs-on: ubuntu-latest + permissions: + id-token: write steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.PAT }} - ref: ${{ github.head_ref }} - - uses: actions/setup-python@v5 + - uses: ./.github/actions/setup-python-and-git with: - python-version: '3.11' - cache: 'pip' # caching pip dependencies + python-version: "3.12" - name: Install requirements shell: bash run: | - python -m pip install --disable-pip-version-check --no-python-version-warning build - python -m pip install --disable-pip-version-check --no-python-version-warning -e . + uv pip install build + uv pip install bump-my-version - name: Set dev version shell: bash @@ -79,9 +65,7 @@ jobs: export PR_NUMBER=$(gh pr view --json number -q .number || echo "") echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV echo "::notice::PR_NUMBER is: ${PR_NUMBER}" - bump-my-version bump dev bumpversion/__init__.py --no-commit --no-tag --no-configured-files -v - env: - GH_TOKEN: ${{ secrets.PAT }} + bump-my-version bump dev --no-commit --no-tag -v - name: Package shell: bash