Skip to content

Commit

Permalink
Merge pull request #46 from paketo-buildpacks/update/pipeline
Browse files Browse the repository at this point in the history
Bump pipeline from 1.21.1 to 1.21.2
  • Loading branch information
Daniel Mikusa authored Apr 19, 2022
2 parents 258716b + 15b68de commit 706ce35
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .github/pipeline-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.1
1.21.2
4 changes: 2 additions & 2 deletions .github/workflows/create-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
password: ${{ secrets.JAVA_GCLOUD_SERVICE_ACCOUNT_KEY }}
registry: gcr.io
username: _json_key
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Install create-package
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
echo "experimental = true" >> "${HOME}"/.pack/config.toml
- uses: actions/checkout@v3
- if: ${{ false }}
uses: actions/cache@v2
uses: actions/cache@v3
with:
key: ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }}
path: |-
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Install create-package
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
mkdir -p "${HOME}"/.pack
echo "experimental = true" >> "${HOME}"/.pack/config.toml
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }}
path: |-
Expand Down Expand Up @@ -169,12 +169,12 @@ jobs:
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
path: ${{ env.HOME }}/go/pkg/mod
restore-keys: ${{ runner.os }}-go-
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Install richgo
Expand Down
181 changes: 7 additions & 174 deletions .github/workflows/update-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,179 +13,12 @@ jobs:
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.JAVA_GITHUB_TOKEN }}
- 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"
chmod +x "${HOME}"/bin/yj
env:
YJ_VERSION: 5.0.0
- uses: actions/checkout@v3
- name: Update draft release with buildpack information
run: |
#!/usr/bin/env bash
set -euo pipefail
PAYLOAD="{}"
if [[ -e buildpack.toml ]]; then
PAYLOAD=$(jq -n -r \
--argjson PAYLOAD "${PAYLOAD}" \
--argjson BUILDPACK "$(yj -tj < buildpack.toml)" \
'$PAYLOAD | .primary = $BUILDPACK')
fi
if [[ -e builder.toml ]]; then
PAYLOAD=$(jq -n -r \
--argjson PAYLOAD "${PAYLOAD}" \
--argjson BUILDER "$(yj -tj < builder.toml)" \
'$PAYLOAD | .primary = $BUILDER')
for BUILDPACK in $(
jq -n -r \
--argjson PAYLOAD "${PAYLOAD}" \
'$PAYLOAD.primary.buildpacks[].uri | capture("(?:.+://)?(?<image>.+)") | .image'
); do
crane export "${BUILDPACK}" - | tar xf - --absolute-names --strip-components 1 --wildcards "/cnb/buildpacks/*/*/buildpack.toml"
done
fi
if [[ -e package.toml ]]; then
for PACKAGE in $(yj -t < package.toml | jq -r '.dependencies[].uri | capture("(?:.+://)?(?<image>.+)") | .image'); do
crane export "${PACKAGE}" - | tar xf - --absolute-names --strip-components 1 --wildcards "/cnb/buildpacks/*/*/buildpack.toml"
done
fi
if [[ -d buildpacks ]]; then
while IFS= read -r -d '' FILE; do
PAYLOAD=$(jq -n -r \
--argjson PAYLOAD "${PAYLOAD}" \
--argjson BUILDPACK "$(yj -tj < "${FILE}")" \
'$PAYLOAD | .buildpacks += [ $BUILDPACK ]')
done < <(find buildpacks -name buildpack.toml -print0)
fi
jq -n -r \
--argjson PAYLOAD "${PAYLOAD}" \
--arg RELEASE_NAME "${RELEASE_NAME}" \
'( select($PAYLOAD.primary.buildpack.name) | "\($PAYLOAD.primary.buildpack.name) \($RELEASE_NAME)" ) // "\($RELEASE_NAME)"' \
> "${HOME}"/name
jq -n -r \
--argjson PAYLOAD "${PAYLOAD}" \
--arg RELEASE_BODY "${RELEASE_BODY}" \
'
def id(b):
select(b.buildpack.id) | "**ID**: `\(b.buildpack.id)`"
;
def included_buildpackages(b): [
"#### Included Buildpackages:",
"Name | ID | Version",
":--- | :- | :------",
( b | sort_by(.buildpack.name | ascii_downcase) | map("\(.buildpack.name) | `\(.buildpack.id)` | `\(.buildpack.version)`") ),
""
];
def stacks(s): [
"#### Supported Stacks:",
( s | sort_by(.id | ascii_downcase) | map("- `\(.id)`") ),
""
];
def default_dependency_versions(d): [
"#### Default Dependency Versions:",
"ID | Version",
":- | :------",
( d | to_entries | sort_by(.key | ascii_downcase) | map("`\(.key)` | `\(.value)`") ),
""
];
def dependencies(d): [
"#### Dependencies:",
"Name | Version | SHA256",
":--- | :------ | :-----",
( d | sort_by(.name // .id | ascii_downcase) | map("\(.name // .id) | `\(.version)` | `\(.sha256)`")),
""
];
def order_groupings(o): [
"<details>",
"<summary>Order Groupings</summary>",
"",
( o | map([
"ID | Version | Optional",
":- | :------ | :-------",
( .group | map([ "`\(.id)` | ", (select(.version) | "`\(.version)`"), ( select(.optional) | "| `\(.optional)`" ) ] | join(" ")) ),
""
])),
"</details>",
""
];
def primary_buildpack(p): [
id(p.primary),
"**Digest**: <!-- DIGEST PLACEHOLDER -->",
"",
( select(p.buildpacks) | included_buildpackages(p.buildpacks) ),
( select(p.primary.stacks) | stacks(p.primary.stacks) ),
( select(p.primary.metadata."default-versions") | default_dependency_versions(p.primary.metadata."default-versions") ),
( select(p.primary.metadata.dependencies) | dependencies(p.primary.metadata.dependencies) ),
( select(p.primary.order) | order_groupings(p.primary.order) ),
( select(p.buildpacks) | "---" ),
""
];
def nested_buildpack(b): [
"<details>",
"<summary>\(b.buildpack.name) \(b.buildpack.version)</summary>",
"",
id(b),
"",
( select(b.stacks) | stacks(b.stacks) ),
( select(b.metadata."default-versions") | default_dependency_versions(b.metadata."default-versions") ),
( select(b.metadata.dependencies) | dependencies(b.metadata.dependencies) ),
( select(b.order) | order_groupings(b.order) ),
"---",
"",
"</details>",
""
];
$PAYLOAD | [
primary_buildpack(.),
( select(.buildpacks) | [ .buildpacks | sort_by(.buildpack.name | ascii_downcase) | map(nested_buildpack(.)) ] ),
"",
"---",
"",
$RELEASE_BODY
] | flatten | join("\n")
' > "${HOME}"/body
gh api \
--method PATCH \
"/repos/:owner/:repo/releases/${RELEASE_ID}" \
--field "tag_name=${RELEASE_TAG_NAME}" \
--field "name=@${HOME}/name" \
--field "body=@${HOME}/body"
env:
GITHUB_TOKEN: ${{ secrets.JAVA_GITHUB_TOKEN }}
RELEASE_BODY: ${{ steps.release-drafter.outputs.body }}
RELEASE_ID: ${{ steps.release-drafter.outputs.id }}
RELEASE_NAME: ${{ steps.release-drafter.outputs.name }}
RELEASE_TAG_NAME: ${{ steps.release-drafter.outputs.tag_name }}
uses: docker://ghcr.io/paketo-buildpacks/actions/draft-release:main
with:
github_token: ${{ secrets.JAVA_GITHUB_TOKEN }}
release_body: ${{ steps.release-drafter.outputs.body }}
release_id: ${{ steps.release-drafter.outputs.id }}
release_name: ${{ steps.release-drafter.outputs.name }}
release_tag_name: ${{ steps.release-drafter.outputs.tag_name }}
4 changes: 2 additions & 2 deletions .github/workflows/update-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Install octo
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
env:
DESCRIPTOR: .github/pipeline-descriptor.yml
GITHUB_TOKEN: ${{ secrets.JAVA_GITHUB_TOKEN }}
- uses: peter-evans/create-pull-request@v3
- uses: peter-evans/create-pull-request@v4
with:
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
body: |-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-syft-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Install update-buildpack-dependency
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
URI: ${{ steps.dependency.outputs.uri }}
VERSION: ${{ steps.dependency.outputs.version }}
VERSION_PATTERN: '[\d]+\.[\d]+\.[\d]+'
- uses: peter-evans/create-pull-request@v3
- uses: peter-evans/create-pull-request@v4
with:
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
body: Bumps `Syft CLI` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`.
Expand Down

0 comments on commit 706ce35

Please sign in to comment.