diff --git a/.github/workflows/egg-pytest.yml b/.github/workflows/egg-pytest.yml new file mode 100644 index 0000000..887722a --- /dev/null +++ b/.github/workflows/egg-pytest.yml @@ -0,0 +1,81 @@ +name: egg-pytest +permissions: + contents: read + +on: + - pull_request + - push + +env: + PYTHON_LATEST_VERSION: '3.14' + +jobs: + pytest: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ['3.11', '3.12', '3.13', '3.14'] + + steps: + - uses: actions/checkout@v6 + + - uses: astral-sh/setup-uv@v7 + with: + python-version: ${{ matrix.python-version }} + enable-cache: true + + - name: dependencies + working-directory: egg + run: uv sync --locked --extra dev + + - name: pytest + working-directory: egg + run: uv run pytest + + build: + runs-on: ubuntu-latest + needs: pytest + + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')" + + steps: + - uses: actions/checkout@v6 + + - name: recovery tag information + run: git fetch --tags --force + + - uses: astral-sh/setup-uv@v7 + with: + python-version: ${{ env.PYTHON_LATEST_VERSION }} + enable-cache: true + + - name: build + working-directory: egg + run: uv build + + - uses: actions/upload-artifact@v6 + with: + name: dist + path: egg/dist/*.whl + + upload: + runs-on: ubuntu-latest + needs: build + + environment: + name: pypi-egg + url: https://pypi.org/project/apyds-egg + permissions: + id-token: write + + steps: + - uses: actions/download-artifact@v7 + with: + name: dist + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist