Skip to content

Commit

Permalink
multi-arch support for create-draft-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pacostas committed Dec 12, 2024
1 parent eece82e commit 334b9fd
Showing 1 changed file with 38 additions and 13 deletions.
51 changes: 38 additions & 13 deletions .github/workflows/create-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,43 @@ jobs:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
buildpack_type: ${{ steps.get_buildpack_type.outputs.buildpack_type }}

- name: Create release assets
id: create_release_assets
run: |
release_assets=$(jq -n --arg repo_name "${{ github.event.repository.name }}" --arg tag "${{ steps.tag.outputs.tag }}" '
[
{
"path": "build/buildpack.tgz",
"name": ($repo_name + "-" + $tag + ".tgz"),
"content_type": "application/gzip"
}
]')
for filepath in build/*.cnb; do
filename=$(basename "$filepath")
asset_name=""
if [[ "$filename" == "buildpackage-linux-amd64.cnb" ]]; then
asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb"
elif [[ "$filename" == "buildpackage.cnb" ]]; then
asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb"
else
asset_name="${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}-${filename}"
fi
release_assets=$(echo "$release_assets" | jq --arg asset_name "${asset_name}" --arg filepath "$filepath" '
. + [
{
"path": $filepath,
"name": $asset_name,
"content_type": "application/gzip"
}
]')
done
release_assets=$(jq -c <<< "$release_assets" )
printf "release_assets=%s\n" "${release_assets}" >> "$GITHUB_OUTPUT"
- name: Create Release
uses: paketo-buildpacks/github-config/actions/release/create@main
with:
Expand All @@ -128,19 +165,7 @@ jobs:
name: v${{ steps.tag.outputs.tag }}
body: ${{ steps.create-release-notes.outputs.release_body }}
draft: true
assets: |
[
{
"path": "build/buildpack.tgz",
"name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.tgz",
"content_type": "application/gzip"
},
{
"path": "build/buildpackage.cnb",
"name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb",
"content_type": "application/gzip"
}
]
assets: ${{ steps.create_release_assets.outputs.release_assets }}

failure:
name: Alert on Failure
Expand Down

0 comments on commit 334b9fd

Please sign in to comment.