Skip to content

Commit

Permalink
Merge pull request #224 from paketo-buildpacks/arm64
Browse files Browse the repository at this point in the history
Add ARM64 binaries
  • Loading branch information
anthonydahanne authored Jan 23, 2024
2 parents 8831713 + 8ad019b commit 18164ef
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/pipeline-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@ dependencies:
repository: syft
tag_filter: v(0.*)
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}

# ARM64
- name: Syft CLI ARM64
id: syft
uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main
with:
glob: syft_.+_linux_arm64.tar.gz
owner: anchore
repository: syft
tag_filter: v(0.*)
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
121 changes: 121 additions & 0 deletions .github/workflows/pb-update-syft-cli-arm-64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Update Syft CLI ARM64
"on":
schedule:
- cron: 0 5 * * 1-5
workflow_dispatch: {}
jobs:
update:
name: Update Buildpack Dependency
runs-on:
- ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Install update-buildpack-dependency
run: |
#!/usr/bin/env bash
set -euo pipefail
go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest
- name: Install yj
run: |
#!/usr/bin/env bash
set -euo pipefail
echo "Installing yj ${YJ_VERSION}"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl \
--location \
--show-error \
--silent \
--output "${HOME}"/bin/yj \
"https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux-amd64"
chmod +x "${HOME}"/bin/yj
env:
YJ_VERSION: 5.1.0
- uses: actions/checkout@v4
- id: dependency
uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main
with:
glob: syft_.+_linux_arm64.tar.gz
owner: anchore
repository: syft
tag_filter: v(0.*)
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
- name: Update Buildpack Dependency
id: buildpack
run: |
#!/usr/bin/env bash
set -euo pipefail
if [ -z "${ARCH}" ]; then
ARCH="amd64"
fi
OLD_VERSION=$(yj -tj < buildpack.toml | \
jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) ) | select( .purl | contains( env.ARCH ) ) | .version")
update-buildpack-dependency \
--buildpack-toml buildpack.toml \
--id "${ID}" \
--arch "${ARCH}" \
--version-pattern "${VERSION_PATTERN}" \
--version "${VERSION}" \
--cpe-pattern "${CPE_PATTERN:-}" \
--cpe "${CPE:-}" \
--purl-pattern "${PURL_PATTERN:-}" \
--purl "${PURL:-}" \
--uri "${URI}" \
--sha256 "${SHA256}" \
--source "${SOURCE_URI}" \
--source-sha256 "${SOURCE_SHA256}"
git add buildpack.toml
git checkout -- .
if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then
LABEL="semver:major"
elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then
LABEL="semver:minor"
else
LABEL="semver:patch"
fi
echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT"
echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT"
env:
ARCH: ""
CPE: ${{ steps.dependency.outputs.cpe }}
CPE_PATTERN: ""
ID: syft
PURL: ${{ steps.dependency.outputs.purl }}
PURL_PATTERN: ""
SHA256: ${{ steps.dependency.outputs.sha256 }}
SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }}
SOURCE_URI: ${{ steps.dependency.outputs.source }}
URI: ${{ steps.dependency.outputs.uri }}
VERSION: ${{ steps.dependency.outputs.version }}
VERSION_PATTERN: '[\d]+\.[\d]+\.[\d]+'
- uses: peter-evans/create-pull-request@v5
with:
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
body: Bumps `Syft CLI ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`.
branch: update/buildpack/syft-cli-arm-64
commit-message: |-
Bump Syft CLI ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}
Bumps Syft CLI ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}.
delete-branch: true
labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade
signoff: true
title: Bump Syft CLI ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
24 changes: 17 additions & 7 deletions buildpack.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2021 the original author or authors.
# Copyright 2018-2024 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,23 +35,33 @@ api = "0.7"
cpes = ["cpe:2.3:a:anchore:syft:0.101.0:*:*:*:*:*:*:*"]
id = "syft"
name = "Syft"
purl = "pkg:generic/anchore-syft@0.101.0"
purl = "pkg:generic/anchore-syft@0.101.0?arch=amd64"
sha256 = "6ab16fd950f218a2682c2c126371b19e13adf717860299f64924a8b147d08e47"
source = "https://github.com/anchore/syft/archive/refs/tags/v0.101.0.tar.gz"
source-sha256 = "6b36bf53efd6fd13e5162930c4902895f0894dbd77be7a5277dd11412fec994c"
stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"]
stacks = ["*"]
uri = "https://github.com/anchore/syft/releases/download/v0.101.0/syft_0.101.0_linux_amd64.tar.gz"
version = "0.101.0"

[[metadata.dependencies.licenses]]
type = "Apache-2.0"
uri = "https://github.com/anchore/syft/blob/main/LICENSE"

[[stacks]]
id = "io.buildpacks.stacks.bionic"
[[metadata.dependencies]]
cpes = ["cpe:2.3:a:anchore:syft:0.101.0:*:*:*:*:*:*:*"]
id = "syft"
name = "Syft"
purl = "pkg:generic/anchore-syft@0.101.0?arch=arm64"
sha256 = "dbdcbf7fe69d8e8594d4bfdca1d7699229b655c0d23285fc16ce6ba991d7c63a"
source = "https://github.com/anchore/syft/archive/refs/tags/v0.101.0.tar.gz"
source-sha256 = "6b36bf53efd6fd13e5162930c4902895f0894dbd77be7a5277dd11412fec994c"
stacks = ["*"]
uri = "https://github.com/anchore/syft/releases/download/v0.101.1/syft_0.101.1_linux_arm64.tar.gz"
version = "0.101.0"

[[stacks]]
id = "io.paketo.stacks.tiny"
[[metadata.dependencies.licenses]]
type = "Apache-2.0"
uri = "https://github.com/anchore/syft/blob/main/LICENSE"

[[stacks]]
id = "*"

0 comments on commit 18164ef

Please sign in to comment.