diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index a078484..3fe0e68 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -2,38 +2,34 @@ name: Publish to PyPI on: push: - branches: [ "hatch" ] + branches: [ "hatch" ] #main can be added release: types: [published] -permissions: - contents: read +# permissions: +# contents: read +# id-token: write # Ensure this permission is available for trusted publishing jobs: deploy: - runs-on: ubuntu-latest - environment: release - permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' - - name: Install dependencies - run: | - # python -m pip install --upgrade pip - pip install hatch - - name: Build package - run: hatch build - - name: Test package - run: hatch -e test run nose2 --verbose - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' + - name: Install dependencies + run: pip install hatch + - name: Build package + run: hatch build + - name: Test package + run: hatch -e test run nose2 --verbose + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip_existing: true + password: ${{ secrets.MY_PYPI_API_TOKEN }} # Ensure your PyPI API token is set in secrets otherwise use trusted publishers mode + repository-url: https://upload.pypi.org/legacy/ # Use Test PyPI or main PyPI https://upload.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index 5c0b8c0..fee31ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,13 +70,13 @@ dependencies = [ "loguru" ] -#[tool.hatch.envs.test.env-vars] -#RETRY_ATTEMPTS="0" +[tool.hatch.envs.test.env-vars] +RETRY_ATTEMPTS="0" [tool.hatch.envs.test.scripts] test = "hatch run nose2" testv = "hatch run nose2 --verbose" -#cov = ["coverage run --source=src -m nose2", "coverage report"] +cov = ["coverage run --source=src -m nose2", "coverage report"] [[tool.hatch.envs.test.matrix]] -python = ["3.8", "3.9", "3.10", "3.11", "3.12"] \ No newline at end of file +python = ["3.8", "3.9", "3.10", "3.11", "3.12"]