Skip to content

Commit 77ee54a

Browse files
committed
Add output for name of uploaded artifact
1 parent 92f078e commit 77ee54a

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
path: structlog
5555
upload-name-suffix: "-structlog"
5656

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

5959
check-pytest:
6060
name: Build & verify the pytest package.
@@ -76,4 +76,4 @@ jobs:
7676
path: pytest
7777
upload-name-suffix: "-pytest"
7878

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

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77

88
## [Unreleased](https://github.com/hynek/build-and-inspect-python-package/compare/v2.5.0...main)
99

10+
### Added
11+
12+
- New output: `artifact-name` is the name of the uploaded artifact.
1013

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

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ While *build-and-inspect-python-package* will build a wheel for you by default,
103103

104104
### Outputs
105105

106+
- `artifact-name`: The name of the uploaded artifact.
107+
106108
- `dist`: The location with the built packages.
107109

108110
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.

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ inputs:
2424
required: false
2525
default: 'false'
2626
outputs:
27+
artifact-name:
28+
description: The name of the uploaded artifact.
29+
value: ${{ steps.artifact.outputs.name }}
2730
dist:
2831
description: The location of the built packages.
2932
value: ${{ steps.dist-location-setter.outputs.dist }}
@@ -88,6 +91,11 @@ runs:
8891
env:
8992
VIRTUAL_ENV: /tmp/baipp
9093

94+
- name: Artifact Name
95+
id: artifact
96+
run: echo "name=Packages${{ inputs.upload-name-suffix }}" >>${GITHUB_OUTPUT}
97+
shell: bash
98+
9199
# Build SDist, then build wheel out of it if the user didn't forbid it.
92100
# Set 'SOURCE_DATE_EPOCH' based on the last commit for build
93101
# reproducibility.
@@ -125,7 +133,7 @@ runs:
125133
- name: Upload built artifacts.
126134
uses: actions/upload-artifact@v4
127135
with:
128-
name: Packages${{ inputs.upload-name-suffix }}
136+
name: ${{ steps.artifact.outputs.name }}
129137
path: /tmp/baipp/dist/*
130138

131139
- name: Check wheel contents if one was built

0 commit comments

Comments
 (0)