From fbbc2278dd77b1fcb5409db0132820b2093088f7 Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Mon, 14 Oct 2024 16:11:04 -0700 Subject: [PATCH] add publish task to check if package builds properly --- .github/workflows/tests.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 687b66b..4c00a67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,3 +47,33 @@ jobs: # uses: codecov/codecov-action@v4.0.1 # with: # token: ${{ secrets.CODECOV_TOKEN }} + + publish: + runs-on: ubuntu-latest + + # Steps for running tests and analysis. + steps: + - name: Checking out repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + submodules: recursive + + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 + with: + version: "0.4.x" + enable-cache: true + + - name: Install Python 3.12 + run: uv python install 3.12 + + - name: Build package + run: uv build + + - name: Check package can be imported + run: uv run --with dist/dtspy-*-py3-none-any.whl --no-project -- python -c "import dts" + + # when ready to upload to PyPI + # name: upload to PyPI + # run: uv publish