From 2df5cbf78b36c6783383362bba0b6a773a05926d Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Wed, 27 Mar 2024 23:10:41 -0400 Subject: [PATCH 1/2] dual arch versions --- buildpack.toml | 30 +++++++++++++++--------------- package.toml | 38 +++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/buildpack.toml b/buildpack.toml index 8af3044e..8f8d6ce3 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -34,72 +34,72 @@ api = "0.7" [[order.group]] id = "paketo-buildpacks/ca-certificates" optional = true - version = "3.6.8" + version = "3.7.0" [[order.group]] id = "paketo-buildpacks/upx" optional = true - version = "3.4.8" + version = "3.5.0" [[order.group]] id = "paketo-buildpacks/bellsoft-liberica" - version = "10.5.5" + version = "10.6.0" [[order.group]] id = "paketo-buildpacks/syft" optional = true - version = "1.45.0" + version = "1.46.0" [[order.group]] id = "paketo-buildpacks/leiningen" optional = true - version = "4.7.1" + version = "4.8.0" [[order.group]] id = "paketo-buildpacks/gradle" optional = true - version = "7.9.0" + version = "7.10.0" [[order.group]] id = "paketo-buildpacks/maven" optional = true - version = "6.15.14" + version = "6.16.0" [[order.group]] id = "paketo-buildpacks/sbt" optional = true - version = "6.12.13" + version = "6.13.0" [[order.group]] id = "paketo-buildpacks/executable-jar" optional = true - version = "6.8.5" + version = "6.9.0" [[order.group]] id = "paketo-buildpacks/spring-boot" optional = true - version = "5.27.11" + version = "5.28.0" [[order.group]] id = "paketo-buildpacks/datadog" optional = true - version = "5.7.0" + version = "5.8.0" [[order.group]] id = "paketo-buildpacks/native-image" - version = "5.12.9" + version = "5.13.0" [[order.group]] id = "paketo-buildpacks/procfile" optional = true - version = "5.6.9" + version = "5.7.0" [[order.group]] id = "paketo-buildpacks/environment-variables" optional = true - version = "4.5.7" + version = "4.6.0" [[order.group]] id = "paketo-buildpacks/image-labels" optional = true - version = "4.5.6" + version = "4.6.0" diff --git a/package.toml b/package.toml index a7982eb8..a7bf6c67 100644 --- a/package.toml +++ b/package.toml @@ -1,44 +1,52 @@ [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/ca-certificates:3.6.8" + uri = "docker://gcr.io/paketo-buildpacks/ca-certificates:3.7.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/upx:3.4.8" + uri = "docker://gcr.io/paketo-buildpacks/upx:3.5.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/bellsoft-liberica:10.5.5" + uri = "docker://gcr.io/paketo-buildpacks/bellsoft-liberica:10.6.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/syft:1.45.0" + uri = "docker://gcr.io/paketo-buildpacks/syft:1.46.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/leiningen:4.7.1" + uri = "docker://gcr.io/paketo-buildpacks/leiningen:4.8.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/gradle:7.9.0" + uri = "docker://gcr.io/paketo-buildpacks/gradle:7.10.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/maven:6.15.14" + uri = "docker://gcr.io/paketo-buildpacks/maven:6.16.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/sbt:6.12.13" + uri = "docker://gcr.io/paketo-buildpacks/sbt:6.13.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/executable-jar:6.8.5" + uri = "docker://gcr.io/paketo-buildpacks/executable-jar:6.9.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/spring-boot:5.27.11" + uri = "docker://gcr.io/paketo-buildpacks/spring-boot:5.28.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/datadog:5.7.0" + uri = "docker://gcr.io/paketo-buildpacks/datadog:5.8.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/native-image:5.12.9" + uri = "docker://gcr.io/paketo-buildpacks/native-image:5.13.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/procfile:5.6.9" + uri = "docker://gcr.io/paketo-buildpacks/procfile:5.7.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/environment-variables:4.5.7" + uri = "docker://gcr.io/paketo-buildpacks/environment-variables:4.6.0" [[dependencies]] - uri = "docker://gcr.io/paketo-buildpacks/image-labels:4.5.6" + uri = "docker://gcr.io/paketo-buildpacks/image-labels:4.6.0" + +[[targets]] +os = "linux" +arch = "amd64" + +[[targets]] +os = "linux" +arch = "arm64" From 967abab00ffdf37495162f90ba180449de0038a8 Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Mon, 1 Apr 2024 10:59:17 -0400 Subject: [PATCH 2/2] Publish beta version --- .github/workflows/pb-create-package.yml | 141 ++++++++++++------------ 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/.github/workflows/pb-create-package.yml b/.github/workflows/pb-create-package.yml index 21a0a8e0..d32727fc 100644 --- a/.github/workflows/pb-create-package.yml +++ b/.github/workflows/pb-create-package.yml @@ -1,8 +1,8 @@ name: Create Package "on": - release: - types: - - published + push: + branches: "dualarch" + jobs: create-package: name: Create Package @@ -71,37 +71,37 @@ jobs: ${{ env.HOME }}/.pack ${{ env.HOME }}/carton-cache restore-keys: ${{ runner.os }}-go- - - name: Compute Version - id: version - run: | - #!/usr/bin/env bash - - set -euo pipefail - - if [[ ${GITHUB_REF:-} != "refs/"* ]]; then - echo "GITHUB_REF set to [${GITHUB_REF:-}], but that is unexpected. It should start with 'refs/*'" - exit 255 - fi - - if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then - VERSION=${BASH_REMATCH[1]} - - MAJOR_VERSION="$(echo "${VERSION}" | awk -F '.' '{print $1 }')" - MINOR_VERSION="$(echo "${VERSION}" | awk -F '.' '{print $1 "." $2 }')" - - echo "version-major=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT" - echo "version-minor=${MINOR_VERSION}" >> "$GITHUB_OUTPUT" - elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then - VERSION=${BASH_REMATCH[1]} - else - VERSION=$(git rev-parse --short HEAD) - fi - - echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - echo "Selected ${VERSION} from - * ref: ${GITHUB_REF} - * sha: ${GITHUB_SHA} - " + # - name: Compute Version + # id: version + # run: | + # #!/usr/bin/env bash + + # set -euo pipefail + + # if [[ ${GITHUB_REF:-} != "refs/"* ]]; then + # echo "GITHUB_REF set to [${GITHUB_REF:-}], but that is unexpected. It should start with 'refs/*'" + # exit 255 + # fi + + # if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then + # VERSION=${BASH_REMATCH[1]} + + # MAJOR_VERSION="$(echo "${VERSION}" | awk -F '.' '{print $1 }')" + # MINOR_VERSION="$(echo "${VERSION}" | awk -F '.' '{print $1 "." $2 }')" + + # echo "version-major=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT" + # echo "version-minor=${MINOR_VERSION}" >> "$GITHUB_OUTPUT" + # elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then + # VERSION=${BASH_REMATCH[1]} + # else + # VERSION=$(git rev-parse --short HEAD) + # fi + + # echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + # echo "Selected ${VERSION} from + # * ref: ${GITHUB_REF} + # * sha: ${GITHUB_SHA} + # " - name: Create Package run: | #!/usr/bin/env bash @@ -145,7 +145,7 @@ jobs: #!/usr/bin/env bash set -euo pipefail - + COMPILED_BUILDPACK="${HOME}/buildpack" # create-package puts the buildpack here, we need to run from that directory @@ -159,7 +159,10 @@ jobs: PACKAGE_LIST=($PACKAGES) # Extract first repo (Docker Hub) as the main to package & register PACKAGE=${PACKAGE_LIST[0]} - + + # because current pack exp. will keep on piling up layers if you directly publish to an existing tag + crane delete "${PACKAGE}:${VERSION}" + if [[ "${PUBLISH:-x}" == "true" ]]; then pack -v buildpack package \ "${PACKAGE}:${VERSION}" ${CONFIG} \ @@ -169,7 +172,7 @@ jobs: crane tag "${PACKAGE}:${VERSION}" "${VERSION_MINOR}" crane tag "${PACKAGE}:${VERSION}" "${VERSION_MAJOR}" fi - crane tag "${PACKAGE}:${VERSION}" latest + # crane tag "${PACKAGE}:${VERSION}" latest echo "digest=$(crane digest "${PACKAGE}:${VERSION}")" >> "$GITHUB_OUTPUT" # copy to other repositories specified @@ -181,7 +184,7 @@ jobs: crane tag "${P}:${VERSION}" "${VERSION_MINOR}" crane tag "${P}:${VERSION}" "${VERSION_MAJOR}" fi - crane tag "${P}:${VERSION}" latest + # crane tag "${P}:${VERSION}" latest fi done @@ -193,35 +196,33 @@ jobs: env: PACKAGES: docker.io/paketobuildpacks/java-native-image gcr.io/paketo-buildpacks/java-native-image PUBLISH: "true" - VERSION: ${{ steps.version.outputs.version }} - VERSION_MAJOR: ${{ steps.version.outputs.version-major }} - VERSION_MINOR: ${{ steps.version.outputs.version-minor }} - - name: Update release with digest - run: | - #!/usr/bin/env bash - - set -euo pipefail - - PAYLOAD=$(cat "${GITHUB_EVENT_PATH}") - - RELEASE_ID=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.id') - RELEASE_TAG_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.tag_name') - RELEASE_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.name') - RELEASE_BODY=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.body') - - gh api \ - --method PATCH \ - "/repos/:owner/:repo/releases/${RELEASE_ID}" \ - --field "tag_name=${RELEASE_TAG_NAME}" \ - --field "name=${RELEASE_NAME}" \ - --field "body=${RELEASE_BODY///\`${DIGEST}\`}" - env: - DIGEST: ${{ steps.package.outputs.digest }} - GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - - if: ${{ true }} - uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.5.3 - with: - address: docker.io/paketobuildpacks/java-native-image@${{ steps.package.outputs.digest }} - id: paketo-buildpacks/java-native-image - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - version: ${{ steps.version.outputs.version }} + VERSION: "beta" + # - name: Update release with digest + # run: | + # #!/usr/bin/env bash + + # set -euo pipefail + + # PAYLOAD=$(cat "${GITHUB_EVENT_PATH}") + + # RELEASE_ID=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.id') + # RELEASE_TAG_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.tag_name') + # RELEASE_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.name') + # RELEASE_BODY=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.body') + + # gh api \ + # --method PATCH \ + # "/repos/:owner/:repo/releases/${RELEASE_ID}" \ + # --field "tag_name=${RELEASE_TAG_NAME}" \ + # --field "name=${RELEASE_NAME}" \ + # --field "body=${RELEASE_BODY///\`${DIGEST}\`}" + # env: + # DIGEST: ${{ steps.package.outputs.digest }} + # GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + # - if: ${{ true }} + # uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.5.3 + # with: + # address: docker.io/paketobuildpacks/java-native-image@${{ steps.package.outputs.digest }} + # id: paketo-buildpacks/java-native-image + # token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + # version: ${{ steps.version.outputs.version }}