Skip to content

Commit

Permalink
Merge pull request #114 from paketo-buildpacks/add-arm
Browse files Browse the repository at this point in the history
Add ARM64 dependency
  • Loading branch information
dmikusa authored Mar 28, 2024
2 parents ba80633 + 3fa79c7 commit 3da498e
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/pipeline-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ dependencies:
owner: dmikusa
repository: tiny-health-checker
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}

# ARM64
- name: Tiny Health Checker ARM64
id: thc
uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main
with:
glob: thc-aarch64-unknown-linux-musl
owner: dmikusa
repository: tiny-health-checker
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
105 changes: 105 additions & 0 deletions .github/workflows/pb-update-tiny-health-checker-arm-64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Update Tiny Health Checker 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
- uses: buildpacks/github-actions/[email protected]
with:
crane-version: 0.19.0
yj-version: 5.1.0
- uses: actions/checkout@v4
- id: dependency
uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main
with:
glob: thc-aarch64-unknown-linux-musl
owner: dmikusa
repository: tiny-health-checker
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
- name: Update Buildpack Dependency
id: buildpack
run: |
#!/usr/bin/env bash
set -euo pipefail
VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )")
ARCH=${ARCH:-amd64}
OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version')
if [ -z "$OLD_VERSION" ]; then
ARCH="" # empty means noarch
OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version")
fi
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: thc
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@v6
with:
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
body: Bumps `Tiny Health Checker ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`.
branch: update/buildpack/tiny-health-checker-arm-64
commit-message: |-
Bump Tiny Health Checker ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}
Bumps Tiny Health Checker 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 Tiny Health Checker ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
20 changes: 18 additions & 2 deletions buildpack.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2022 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 @@ -51,14 +51,30 @@ api = "0.7"
sha256 = "8c361a4e7850b4e274dda21bb4ee49dd5fe8374220330a855ecacb43e7a12869"
source = "https://github.com/dmikusa/tiny-health-checker/archive/refs/tags/v0.22.0.tar.gz"
source-sha256 = "054ce7d290ad2839828cf9f9b24b32edc216abde2f9f167843def03402688858"
stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"]
stacks = ["*"]
uri = "https://github.com/dmikusa/tiny-health-checker/releases/download/v0.22.0/thc-x86_64-unknown-linux-musl"
version = "0.22.0"

[[metadata.dependencies.licenses]]
type = "Apache-2"
uri = "https://github.com/dmikusa-pivotal/tiny-health-checker/blob/main/LICENSE"

[[metadata.dependencies]]
cpes = ["cpe:2.3:a:dmikusa-pivotal:tiny-health-checker:0.22.0:*:*:*:*:*:*:*"]
id = "thc"
name = "Tiny Health Checker"
purl = "pkg:generic/[email protected]?arch=arm64"
sha256 = "bad"
source = "https://github.com/dmikusa/tiny-health-checker/archive/refs/tags/v0.22.0.tar.gz"
source-sha256 = "054ce7d290ad2839828cf9f9b24b32edc216abde2f9f167843def03402688858"
stacks = ["*"]
uri = "bad"
version = "0.22.0"

[[metadata.dependencies.licenses]]
type = "Apache-2"
uri = "https://github.com/dmikusa-pivotal/tiny-health-checker/blob/main/LICENSE"

[[stacks]]
id = "*"

Expand Down

0 comments on commit 3da498e

Please sign in to comment.