Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dual arch versions #806

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 71 additions & 70 deletions .github/workflows/pb-create-package.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Create Package
"on":
release:
types:
- published
push:
branches: "dualarch"

jobs:
create-package:
name: Create Package
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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} \
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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 PLACEHOLDER -->/\`${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 PLACEHOLDER -->/\`${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 }}
30 changes: 15 additions & 15 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
38 changes: 23 additions & 15 deletions package.toml
Original file line number Diff line number Diff line change
@@ -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"
Loading