diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dcbf953c09..924f645465 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,10 +14,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - package_dir: - - ./ - - typer_package - - typer_cli_package + package: + - typer-slim + - typer + - typer-cli + env: + dir: ${{ matrix.package == 'typer-slim' && './' || matrix.package == 'typer' && 'typer_package' || matrix.package == 'typer-cli' && 'typer_cli_package' }} permissions: id-token: write steps: @@ -36,9 +38,9 @@ jobs: - name: Install build dependencies run: pip install build - name: Build distribution - working-directory: ${{ matrix.package_dir }} + working-directory: ${{ env.dir }} run: python -m build - name: Publish uses: pypa/gh-action-pypi-publish@v1.8.11 with: - packages-dir: ${{ matrix.package_dir }}/dist/ + packages-dir: ${{ env.dir }}/dist/ diff --git a/.github/workflows/test-redistribute.yml b/.github/workflows/test-redistribute.yml index 9c35c24d56..c16d19d7b4 100644 --- a/.github/workflows/test-redistribute.yml +++ b/.github/workflows/test-redistribute.yml @@ -14,10 +14,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - package_dir: - - ./ - - typer_package - - typer_cli_package + package: + - typer-slim + - typer + - typer-cli + env: + dir: ${{ matrix.package == 'typer-slim' && './' || matrix.package == 'typer' && 'typer_package' || matrix.package == 'typer-cli' && 'typer_cli_package' }} steps: - name: Dump GitHub context env: @@ -34,29 +36,25 @@ jobs: - name: Install build dependencies run: pip install build - name: Build source distribution - working-directory: ${{ matrix.package_dir }} + working-directory: ${{ env.dir }} run: python -m build --sdist - name: Decompress source distribution - working-directory: ${{ matrix.package_dir }} + working-directory: ${{ env.dir }} run: | cd dist tar xvf typer*.tar.gz - name: Install test dependencies - if: ${{ matrix.package_dir == './' }} + if: ${{ matrix.package == 'typer-slim' }} run: | cd dist/typer*/ pip install -r requirements-tests.txt - name: Run source distribution tests - if: ${{ matrix.package_dir == './' }} + if: ${{ matrix.package == 'typer-slim' }} run: | cd dist/typer*/ bash scripts/test.sh - name: Build wheel distribution - working-directory: ${{ matrix.package_dir }} + working-directory: ${{ env.dir }} run: | cd dist pip wheel --no-deps typer*.tar.gz - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT"