diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07a06265..9c1a62ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,14 +35,43 @@ jobs: set -euo pipefail while IFS="" read -r -d "" buildpack_toml_path; do - buildpack_id="$(yj -t < "${buildpack_toml_path}" | jq -r .buildpack.id)" - buildpack_version="$(yj -t < "${buildpack_toml_path}" | jq -r .buildpack.version)" - buildpack_docker_repository="$(yj -t < "${buildpack_toml_path}" | jq -r .metadata.release.docker.repository)" + buildpack_id="$(yj -t <"${buildpack_toml_path}" | jq -r .buildpack.id)" + buildpack_version="$(yj -t <"${buildpack_toml_path}" | jq -r .buildpack.version)" + buildpack_docker_repository="$(yj -t <"${buildpack_toml_path}" | jq -r .metadata.release.docker.repository)" buildpack_path=$(dirname "${buildpack_toml_path}") if [[ $buildpack_id == "${REQUESTED_BUILDPACK_ID}" ]]; then - image_name="${buildpack_docker_repository}:${buildpack_version}" + cnb_shim_tarball_url="https://github.com/heroku/cnb-shim/releases/download/v0.3/cnb-shim-v0.3.tgz" + cnb_shim_tarball_sha256="109cfc01953cb04e69c82eec1c45c7c800bd57d2fd0eef030c37d8fc37a1cb4d" + local_cnb_shim_tarball=$(mktemp) + + v2_buildpack_tarball_url="$(yj -t <"${buildpack_toml_path}" | jq -r .metadata.shim.tarball)" + v2_buildpack_tarball_sha256="$(yj -t <"${buildpack_toml_path}" | jq -r .metadata.shim.sha256)" + local_v2_buildpack_tarball=$(mktemp) + + # If the buildpack has a V2 buildpack tarball in its metadata it's supposed to be a shimmed buildpack. + # We download the shim and the V2 buildpack to the buildpack directory, turning it into a CNB. This transformation + # is transparent for the code that follows after it. + if [[ -n "${v2_buildpack_tarball_url:-}" ]]; then + curl --retry 3 --location "${cnb_shim_tarball_url}" --output "${local_cnb_shim_tarball}" + curl --retry 3 --location "${v2_buildpack_tarball_url}" --output "${local_v2_buildpack_tarball}" + + if ! echo "${cnb_shim_tarball_sha256} ${local_cnb_shim_tarball}" | sha256sum --check --status; then + echo "Checksum verification of cnb_shim failed!" + exit 1 + fi + if ! echo "${v2_buildpack_tarball_sha256} ${local_v2_buildpack_tarball}" | sha256sum --check --status; then + echo "Checksum verification of V2 buildpack tarball failed!" + exit 1 + fi + + mkdir -p "${buildpack_path}/target" + tar -xzmf "${local_cnb_shim_tarball}" -C "${buildpack_path}" + tar -xzmf "${local_v2_buildpack_tarball}" -C "${buildpack_path}/target" + fi + + image_name="${buildpack_docker_repository}:${buildpack_version}" pack package-buildpack --config "${buildpack_path}/package.toml" --publish "${image_name}" echo "::set-output name=id::${buildpack_id}" diff --git a/shimmed-buildpacks/clojure/CHANGELOG.md b/shimmed-buildpacks/clojure/CHANGELOG.md new file mode 100644 index 00000000..9405ebfa --- /dev/null +++ b/shimmed-buildpacks/clojure/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog +## main + +## 0.0.86 +This release is based on a classic Heroku buildpack via [cnb-shim](https://github.com/heroku/cnb-shim). The changelog +for that release can be found here: https://github.com/heroku/heroku-buildpack-clojure/blob/main/CHANGELOG.md#v86 diff --git a/shimmed-buildpacks/clojure/README.md b/shimmed-buildpacks/clojure/README.md new file mode 100644 index 00000000..58e9d354 --- /dev/null +++ b/shimmed-buildpacks/clojure/README.md @@ -0,0 +1,8 @@ +# Heroku Cloud Native Clojure Buildpack + +Note: This is not a _native_ Cloud Native Buildpack yet. Releases of this buildpack are created by shimming classic +[Heroku Clojure buildpack](https://github.com/heroku/heroku-buildpack-clojure) releases via +[cnb-shim](https://github.com/heroku/cnb-shim). + +The code in this directory will only turn into a valid buildpack during the release process. To use this buildpack, use +the release on the official Cloud Native Buildpack registry. diff --git a/shimmed-buildpacks/clojure/buildpack.toml b/shimmed-buildpacks/clojure/buildpack.toml new file mode 100644 index 00000000..cbc89293 --- /dev/null +++ b/shimmed-buildpacks/clojure/buildpack.toml @@ -0,0 +1,22 @@ +api = "0.4" + +[buildpack] +id = "heroku/clojure" +version = "0.0.86" +name = "Clojure" + +[[stacks]] +id = "heroku-18" + +[[stacks]] +id = "heroku-20" + +[[stacks]] +id = "io.buildpacks.stacks.bionic" + +[metadata.shim] +tarball="https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/clojure-v86.tgz" +sha256="c85cb7f4e10a2bc76fc9804d14842ea1021609a23d953359eed30cfd019560d1" + +[metadata.release.docker] +repository="public.ecr.aws/r2f9u0w4/heroku-clojure-buildpack" diff --git a/shimmed-buildpacks/clojure/package.toml b/shimmed-buildpacks/clojure/package.toml new file mode 100644 index 00000000..54b0d2e4 --- /dev/null +++ b/shimmed-buildpacks/clojure/package.toml @@ -0,0 +1,2 @@ +[buildpack] +uri = "." diff --git a/shimmed-buildpacks/gradle/CHANGELOG.md b/shimmed-buildpacks/gradle/CHANGELOG.md new file mode 100644 index 00000000..78fa0527 --- /dev/null +++ b/shimmed-buildpacks/gradle/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog +## main + +## 0.0.34 +This release is based on a classic Heroku buildpack via [cnb-shim](https://github.com/heroku/cnb-shim). The changelog +for that release can be found here: https://github.com/heroku/heroku-buildpack-gradle/blob/main/CHANGELOG.md#v34 diff --git a/shimmed-buildpacks/gradle/README.md b/shimmed-buildpacks/gradle/README.md new file mode 100644 index 00000000..41f15f5e --- /dev/null +++ b/shimmed-buildpacks/gradle/README.md @@ -0,0 +1,8 @@ +# Heroku Cloud Native Gradle Buildpack + +Note: This is not a _native_ Cloud Native Buildpack yet. Releases of this buildpack are created by shimming classic +[Heroku Gradle buildpack](https://github.com/heroku/heroku-buildpack-gradle) releases via +[cnb-shim](https://github.com/heroku/cnb-shim). + +The code in this directory will only turn into a valid buildpack during the release process. To use this buildpack, use +the release on the official Cloud Native Buildpack registry. diff --git a/shimmed-buildpacks/gradle/buildpack.toml b/shimmed-buildpacks/gradle/buildpack.toml new file mode 100644 index 00000000..79505cf2 --- /dev/null +++ b/shimmed-buildpacks/gradle/buildpack.toml @@ -0,0 +1,22 @@ +api = "0.4" + +[buildpack] +id = "heroku/gradle" +version = "0.0.34" +name = "Gradle" + +[[stacks]] +id = "heroku-18" + +[[stacks]] +id = "heroku-20" + +[[stacks]] +id = "io.buildpacks.stacks.bionic" + +[metadata.shim] +tarball="https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/gradle-v34.tgz" +sha256="56d9af33cc9ed33c2dd78991278b49063879d61954ed24cb7974aa7e0d43be8d" + +[metadata.release.docker] +repository="public.ecr.aws/r2f9u0w4/heroku-gradle-buildpack" diff --git a/shimmed-buildpacks/gradle/package.toml b/shimmed-buildpacks/gradle/package.toml new file mode 100644 index 00000000..54b0d2e4 --- /dev/null +++ b/shimmed-buildpacks/gradle/package.toml @@ -0,0 +1,2 @@ +[buildpack] +uri = "." diff --git a/shimmed-buildpacks/scala/CHANGELOG.md b/shimmed-buildpacks/scala/CHANGELOG.md new file mode 100644 index 00000000..a36ccb18 --- /dev/null +++ b/shimmed-buildpacks/scala/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog +## main + +## 0.0.88 +This release is based on a classic Heroku buildpack via [cnb-shim](https://github.com/heroku/cnb-shim). The changelog +for that release can be found here: https://github.com/heroku/heroku-buildpack-scala/blob/main/CHANGELOG.md#v88 diff --git a/shimmed-buildpacks/scala/README.md b/shimmed-buildpacks/scala/README.md new file mode 100644 index 00000000..08582daf --- /dev/null +++ b/shimmed-buildpacks/scala/README.md @@ -0,0 +1,8 @@ +# Heroku Cloud Native Scala Buildpack + +Note: This is not a _native_ Cloud Native Buildpack yet. Releases of this buildpack are created by shimming classic +[Heroku Scala buildpack](https://github.com/heroku/heroku-buildpack-scala) releases via +[cnb-shim](https://github.com/heroku/cnb-shim). + +The code in this directory will only turn into a valid buildpack during the release process. To use this buildpack, use +the release on the official Cloud Native Buildpack registry. diff --git a/shimmed-buildpacks/scala/buildpack.toml b/shimmed-buildpacks/scala/buildpack.toml new file mode 100644 index 00000000..c727c628 --- /dev/null +++ b/shimmed-buildpacks/scala/buildpack.toml @@ -0,0 +1,22 @@ +api = "0.4" + +[buildpack] +id = "heroku/scala" +version = "0.0.88" +name = "Scala" + +[[stacks]] +id = "heroku-18" + +[[stacks]] +id = "heroku-20" + +[[stacks]] +id = "io.buildpacks.stacks.bionic" + +[metadata.shim] +tarball="https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/scala-v88.tgz" +sha256="d11afa35769cb336aded3f985eb8efb10cb689c786fc7b3a75253ba6f4fe846e" + +[metadata.release.docker] +repository="public.ecr.aws/r2f9u0w4/heroku-scala-buildpack" diff --git a/shimmed-buildpacks/scala/package.toml b/shimmed-buildpacks/scala/package.toml new file mode 100644 index 00000000..54b0d2e4 --- /dev/null +++ b/shimmed-buildpacks/scala/package.toml @@ -0,0 +1,2 @@ +[buildpack] +uri = "."