Skip to content

Add output for name of uploaded artifact #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
path: structlog
upload-name-suffix: "-structlog-${{ matrix.os }}"

- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }}
- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }} and in artifact ${{ steps.baipp.outputs.artifact-name }}

check-pytest:
name: Build & verify the pytest package.
Expand All @@ -83,7 +83,7 @@ jobs:
path: pytest
upload-name-suffix: "-pytest"

- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }}
- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }} and in artifact ${{ steps.baipp.outputs.artifact-name }}

required-checks-pass:
name: Ensure everything required is passing for branch protection
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Support for `ubuntu-24.04` builders.
[#126](https://github.com/hynek/build-and-inspect-python-package/pull/126)

- New output: `artifact-name` is the name of the uploaded artifact.
[#125](https://github.com/hynek/build-and-inspect-python-package/pull/125)

## [2.5.0](https://github.com/hynek/build-and-inspect-python-package/compare/v2.4.0...v2.5.0) - 2024-05-13

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ While *build-and-inspect-python-package* will build a wheel for you by default,

### Outputs

- `artifact-name`: The name of the uploaded artifact.

- `dist`: The location with the built packages.

See, for example, how [*argon2-cffi-bindings*](https://github.com/hynek/argon2-cffi-bindings/blob/daff9ceb693312ab8257c60db4cd1c13cd866a35/.github/workflows/ci.yml#L83-L97) uses this feature to check the built wheels don’t break a package that depends on it.
Expand Down
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inputs:
required: false
default: 'false'
outputs:
artifact-name:
description: The name of the uploaded artifact.
value: ${{ steps.artifact.outputs.name }}
dist:
description: The location of the built packages.
value: ${{ steps.dist-location-setter.outputs.dist }}
Expand Down Expand Up @@ -88,6 +91,11 @@ runs:
env:
VIRTUAL_ENV: /tmp/baipp

- name: Artifact Name
id: artifact
run: echo "name=Packages${{ inputs.upload-name-suffix }}" >>${GITHUB_OUTPUT}
shell: bash

# 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.
Expand Down Expand Up @@ -125,7 +133,7 @@ runs:
- name: Upload built artifacts.
uses: actions/upload-artifact@v4
with:
name: Packages${{ inputs.upload-name-suffix }}
name: ${{ steps.artifact.outputs.name }}
path: /tmp/baipp/dist/*

- name: Check wheel contents if one was built
Expand Down