diff --git a/README.md b/README.md index b1634af3..f14dbb58 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ package: include_dependencies: false register: true registry_token: ${{ secrets.JAVA_REGISTRY_TOKEN }} + platform: { os: "windows" } ``` * [Example `create-package.yml`](https://github.com/paketo-buildpacks/adopt-openjdk/blob/main/.github/workflows/create-package.yml) diff --git a/octo/create-package.sh b/octo/create-package.sh index a2bbec49..05b0d0a6 100755 --- a/octo/create-package.sh +++ b/octo/create-package.sh @@ -16,3 +16,7 @@ fi [[ -e package.toml ]] && cp package.toml "${HOME}"/package.toml printf '[buildpack]\nuri = "%s"' "${HOME}"/buildpack >> "${HOME}"/package.toml + +if [ -n "${PLATFORM_OS}" ]; then + printf '[platform]\nos = "%s"' "${PLATFORM_OS}" >> "${HOME}"/package.toml +fi diff --git a/octo/create_package.go b/octo/create_package.go index ad11f415..339cdbaa 100644 --- a/octo/create_package.go +++ b/octo/create_package.go @@ -93,6 +93,7 @@ func ContributeCreatePackage(descriptor Descriptor) (*Contribution, error) { Env: map[string]string{ "INCLUDE_DEPENDENCIES": strconv.FormatBool(descriptor.Package.IncludeDependencies), "VERSION": "${{ steps.version.outputs.version }}", + "PLATFORM_OS": descriptor.Package.Platform.OS, }, }, { diff --git a/octo/descriptor.go b/octo/descriptor.go index 3f27b5d0..d8c9e184 100644 --- a/octo/descriptor.go +++ b/octo/descriptor.go @@ -89,6 +89,11 @@ type Package struct { IncludeDependencies bool `yaml:"include_dependencies"` Register bool RegistryToken string `yaml:"registry_token"` + Platform *Platform +} + +type Platform struct { + OS string } type Test struct {