diff --git a/.github/workflows/ci-argon2-cffi-bindings.yml b/.github/workflows/ci-argon2-cffi-bindings.yml index 329d617..a05281c 100644 --- a/.github/workflows/ci-argon2-cffi-bindings.yml +++ b/.github/workflows/ci-argon2-cffi-bindings.yml @@ -32,3 +32,4 @@ id: baipp with: path: hynek/argon2-cffi-bindings + skip-wheel: 'true' diff --git a/README.md b/README.md index 1332c20..2730188 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ jobs: ### Inputs - `path`: the location of the Python package to build (*optional*, default: `.`). +- `skip-wheel`: Whether to skip building the wheel in addition to the source distribution. + The only meaningful value is `'true'` (note the quotes – GitHub Actions only allow string inputs) and everything else is treated as falsey. + (*optional*, default: `'false'`). ### Outputs diff --git a/action.yml b/action.yml index 003d63f..0286cae 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,10 @@ inputs: description: Where to look for the Python package to inspect. required: false default: . + skip-wheel: + description: Only build the source distribution. + required: false + default: 'false' outputs: dist: description: The location of the built packages. @@ -38,12 +42,18 @@ runs: install -r ${{ github.action_path }}/requirements/tools.txt shell: bash - # Build SDist, then build wheel out of it. + # Build SDist, then build wheel out of it if the user didn't forbid it. # Set 'SOURCE_DATE_EPOCH' based on the last commit for build # reproducibility. - - run: > - SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - /tmp/baipp/bin/python -m build --outdir /tmp/baipp/dist + - name: Build package + run: | + export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) + + if [[ "${{ inputs.skip-wheel }}" == "true" ]]; then + /tmp/baipp/bin/python -m build --sdist --outdir /tmp/baipp/dist + else + /tmp/baipp/bin/python -m build --outdir /tmp/baipp/dist + fi shell: bash working-directory: ${{ inputs.path }} @@ -63,7 +73,11 @@ runs: name: Packages path: /tmp/baipp/dist/* - - run: /tmp/baipp/bin/check-wheel-contents /tmp/baipp/dist/*.whl + - name: Check wheel contents if one was built + run: | + if [[ "${{ inputs.skip-wheel }}" != 'true' ]]; then + /tmp/baipp/bin/check-wheel-contents /tmp/baipp/dist/*.whl + fi shell: bash working-directory: ${{ inputs.path }} @@ -76,23 +90,26 @@ runs: --strict /tmp/baipp/dist/* - - name: Show wheel & SDist contents hierarchically, including metadata. + - name: Show package contents hierarchically, including metadata. shell: bash working-directory: ${{ inputs.path }} run: | cd /tmp/baipp/dist mkdir -p out/sdist - mkdir -p out/wheels - /tmp/baipp/bin/python -m wheel unpack --dest out/wheels *.whl tar xf *.tar.gz -C out/sdist echo -e '\n
SDist contents\n' >> $GITHUB_STEP_SUMMARY (cd /tmp/baipp/dist/out/sdist && tree -Da --timefmt="%Y-%m-%dT%H:%M:%SZ" * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY) echo -e '\n
\n' >> $GITHUB_STEP_SUMMARY - echo -e '\n
Wheel contents\n' >> $GITHUB_STEP_SUMMARY - (cd /tmp/baipp/dist/out/wheels && tree -Da --timefmt="%Y-%m-%dT%H:%M:%SZ" * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY) - echo -e '\n
\n' >> $GITHUB_STEP_SUMMARY + if [[ "${{ inputs.skip-wheel }}" != 'true' ]]; then + mkdir -p out/wheels + /tmp/baipp/bin/python -m wheel unpack --dest out/wheels *.whl + + echo -e '\n
Wheel contents\n' >> $GITHUB_STEP_SUMMARY + (cd /tmp/baipp/dist/out/wheels && tree -Da --timefmt="%Y-%m-%dT%H:%M:%SZ" * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY) + echo -e '\n
\n' >> $GITHUB_STEP_SUMMARY + fi echo ----- Metadata Follows ----- echo -e '\n
Metadata\n' >> $GITHUB_STEP_SUMMARY