@@ -118,6 +118,43 @@ jobs:
118
118
token : ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
119
119
buildpack_type : ${{ steps.get_buildpack_type.outputs.buildpack_type }}
120
120
121
+ - name : Create release assets
122
+ id : create_release_assets
123
+ run : |
124
+ release_assets=$(jq -n --arg repo_name "${{ github.event.repository.name }}" --arg tag "${{ steps.tag.outputs.tag }}" '
125
+ [
126
+ {
127
+ "path": "build/buildpack.tgz",
128
+ "name": ($repo_name + "-" + $tag + ".tgz"),
129
+ "content_type": "application/gzip"
130
+ }
131
+ ]')
132
+
133
+ for filepath in build/*.cnb; do
134
+
135
+ filename=$(basename "$filepath")
136
+ asset_name=""
137
+ if [[ "$filename" == "buildpackage-linux-amd64.cnb" ]]; then
138
+ asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb"
139
+ elif [[ "$filename" == "buildpackage.cnb" ]]; then
140
+ asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb"
141
+ else
142
+ asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}-${filename}"
143
+ fi
144
+
145
+ release_assets=$(echo "$release_assets" | jq --arg asset_name "${asset_name}" --arg filepath "$filepath" '
146
+ . + [
147
+ {
148
+ "path": $filepath,
149
+ "name": $asset_name,
150
+ "content_type": "application/gzip"
151
+ }
152
+ ]')
153
+ done
154
+
155
+ release_assets=$(jq -c <<< "$release_assets" )
156
+ printf "release_assets=%s\n" "${release_assets}" >> "$GITHUB_OUTPUT"
157
+
121
158
- name : Create Release
122
159
uses : paketo-buildpacks/github-config/actions/release/create@main
123
160
with :
@@ -128,19 +165,7 @@ jobs:
128
165
name : v${{ steps.tag.outputs.tag }}
129
166
body : ${{ steps.create-release-notes.outputs.release_body }}
130
167
draft : true
131
- assets : |
132
- [
133
- {
134
- "path": "build/buildpack.tgz",
135
- "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.tgz",
136
- "content_type": "application/gzip"
137
- },
138
- {
139
- "path": "build/buildpackage.cnb",
140
- "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb",
141
- "content_type": "application/gzip"
142
- }
143
- ]
168
+ assets : ${{ steps.create_release_assets.outputs.release_assets }}
144
169
145
170
failure :
146
171
name : Alert on Failure
0 commit comments