diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index c7a3b178..c2114057 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -80,4 +80,40 @@ jobs: uses: codecov/codecov-action@v3 with: name: ${{ matrix.python }}/${{ matrix.os }} - files: cov.xml \ No newline at end of file + files: cov.xml + + dist: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository + runs-on: "ubuntu-latest" + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Build sdist and wheel + run: | + export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) && \ + pipx run build + + - name: Upload sdist and wheel as artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + + - name: Check for packaging errors + run: pipx run twine check --strict dist/* + + - name: Install python packages + uses: ./.github/actions/install_requirements + with: + python_version: '3.10' + requirements_file: requirements.txt + install_options: dist/*.whl + + - name: Test module --version works using the installed wheel + # If more than one module in src/ replace with module name to test + run: python -m nexgen --version \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 8432eeb3..97b7e8d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ hdf5plugin==4.1.3 numpy==1.24.3 pint==0.22 scanspec==0.6.1 -pydantic==1.10.12 \ No newline at end of file +pydantic==1.10.12 +importlib_resources==6.0.1 \ No newline at end of file