Skip to content

Commit 2dc46c8

Browse files
author
Daniel Mikusa
authored
Merge pull request #153 from paketo-buildpacks/update/pipeline
Bump pipeline from 1.21.1 to 1.21.2
2 parents 9f295f9 + 015c70b commit 2dc46c8

5 files changed

Lines changed: 16 additions & 183 deletions

File tree

.github/pipeline-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.21.1
1+
1.21.2

.github/workflows/create-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
password: ${{ secrets.JAVA_GCLOUD_SERVICE_ACCOUNT_KEY }}
1717
registry: gcr.io
1818
username: _json_key
19-
- uses: actions/setup-go@v2
19+
- uses: actions/setup-go@v3
2020
with:
2121
go-version: "1.17"
2222
- name: Install create-package
@@ -77,7 +77,7 @@ jobs:
7777
echo "experimental = true" >> "${HOME}"/.pack/config.toml
7878
- uses: actions/checkout@v3
7979
- if: ${{ false }}
80-
uses: actions/cache@v2
80+
uses: actions/cache@v3
8181
with:
8282
key: ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }}
8383
path: |-

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on:
1111
- ubuntu-latest
1212
steps:
13-
- uses: actions/setup-go@v2
13+
- uses: actions/setup-go@v3
1414
with:
1515
go-version: "1.17"
1616
- name: Install create-package
@@ -51,7 +51,7 @@ jobs:
5151
mkdir -p "${HOME}"/.pack
5252
echo "experimental = true" >> "${HOME}"/.pack/config.toml
5353
- uses: actions/checkout@v3
54-
- uses: actions/cache@v2
54+
- uses: actions/cache@v3
5555
with:
5656
key: ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }}
5757
path: |-
@@ -169,12 +169,12 @@ jobs:
169169
- ubuntu-latest
170170
steps:
171171
- uses: actions/checkout@v3
172-
- uses: actions/cache@v2
172+
- uses: actions/cache@v3
173173
with:
174174
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
175175
path: ${{ env.HOME }}/go/pkg/mod
176176
restore-keys: ${{ runner.os }}-go-
177-
- uses: actions/setup-go@v2
177+
- uses: actions/setup-go@v3
178178
with:
179179
go-version: "1.17"
180180
- name: Install richgo

.github/workflows/update-draft-release.yml

Lines changed: 7 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -13,179 +13,12 @@ jobs:
1313
uses: release-drafter/release-drafter@v5
1414
env:
1515
GITHUB_TOKEN: ${{ secrets.JAVA_GITHUB_TOKEN }}
16-
- name: Install yj
17-
run: |
18-
#!/usr/bin/env bash
19-
20-
set -euo pipefail
21-
22-
echo "Installing yj ${YJ_VERSION}"
23-
24-
mkdir -p "${HOME}"/bin
25-
echo "${HOME}/bin" >> "${GITHUB_PATH}"
26-
27-
curl \
28-
--location \
29-
--show-error \
30-
--silent \
31-
--output "${HOME}"/bin/yj \
32-
"https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux"
33-
34-
chmod +x "${HOME}"/bin/yj
35-
env:
36-
YJ_VERSION: 5.0.0
3716
- uses: actions/checkout@v3
3817
- name: Update draft release with buildpack information
39-
run: |
40-
#!/usr/bin/env bash
41-
42-
set -euo pipefail
43-
44-
PAYLOAD="{}"
45-
46-
if [[ -e buildpack.toml ]]; then
47-
PAYLOAD=$(jq -n -r \
48-
--argjson PAYLOAD "${PAYLOAD}" \
49-
--argjson BUILDPACK "$(yj -tj < buildpack.toml)" \
50-
'$PAYLOAD | .primary = $BUILDPACK')
51-
fi
52-
53-
if [[ -e builder.toml ]]; then
54-
PAYLOAD=$(jq -n -r \
55-
--argjson PAYLOAD "${PAYLOAD}" \
56-
--argjson BUILDER "$(yj -tj < builder.toml)" \
57-
'$PAYLOAD | .primary = $BUILDER')
58-
59-
for BUILDPACK in $(
60-
jq -n -r \
61-
--argjson PAYLOAD "${PAYLOAD}" \
62-
'$PAYLOAD.primary.buildpacks[].uri | capture("(?:.+://)?(?<image>.+)") | .image'
63-
); do
64-
crane export "${BUILDPACK}" - | tar xf - --absolute-names --strip-components 1 --wildcards "/cnb/buildpacks/*/*/buildpack.toml"
65-
done
66-
fi
67-
68-
if [[ -e package.toml ]]; then
69-
for PACKAGE in $(yj -t < package.toml | jq -r '.dependencies[].uri | capture("(?:.+://)?(?<image>.+)") | .image'); do
70-
crane export "${PACKAGE}" - | tar xf - --absolute-names --strip-components 1 --wildcards "/cnb/buildpacks/*/*/buildpack.toml"
71-
done
72-
fi
73-
74-
if [[ -d buildpacks ]]; then
75-
while IFS= read -r -d '' FILE; do
76-
PAYLOAD=$(jq -n -r \
77-
--argjson PAYLOAD "${PAYLOAD}" \
78-
--argjson BUILDPACK "$(yj -tj < "${FILE}")" \
79-
'$PAYLOAD | .buildpacks += [ $BUILDPACK ]')
80-
done < <(find buildpacks -name buildpack.toml -print0)
81-
fi
82-
83-
jq -n -r \
84-
--argjson PAYLOAD "${PAYLOAD}" \
85-
--arg RELEASE_NAME "${RELEASE_NAME}" \
86-
'( select($PAYLOAD.primary.buildpack.name) | "\($PAYLOAD.primary.buildpack.name) \($RELEASE_NAME)" ) // "\($RELEASE_NAME)"' \
87-
> "${HOME}"/name
88-
89-
jq -n -r \
90-
--argjson PAYLOAD "${PAYLOAD}" \
91-
--arg RELEASE_BODY "${RELEASE_BODY}" \
92-
'
93-
def id(b):
94-
select(b.buildpack.id) | "**ID**: `\(b.buildpack.id)`"
95-
;
96-
97-
def included_buildpackages(b): [
98-
"#### Included Buildpackages:",
99-
"Name | ID | Version",
100-
":--- | :- | :------",
101-
( b | sort_by(.buildpack.name | ascii_downcase) | map("\(.buildpack.name) | `\(.buildpack.id)` | `\(.buildpack.version)`") ),
102-
""
103-
];
104-
105-
def stacks(s): [
106-
"#### Supported Stacks:",
107-
( s | sort_by(.id | ascii_downcase) | map("- `\(.id)`") ),
108-
""
109-
];
110-
111-
def default_dependency_versions(d): [
112-
"#### Default Dependency Versions:",
113-
"ID | Version",
114-
":- | :------",
115-
( d | to_entries | sort_by(.key | ascii_downcase) | map("`\(.key)` | `\(.value)`") ),
116-
""
117-
];
118-
119-
def dependencies(d): [
120-
"#### Dependencies:",
121-
"Name | Version | SHA256",
122-
":--- | :------ | :-----",
123-
( d | sort_by(.name // .id | ascii_downcase) | map("\(.name // .id) | `\(.version)` | `\(.sha256)`")),
124-
""
125-
];
126-
127-
def order_groupings(o): [
128-
"<details>",
129-
"<summary>Order Groupings</summary>",
130-
"",
131-
( o | map([
132-
"ID | Version | Optional",
133-
":- | :------ | :-------",
134-
( .group | map([ "`\(.id)` | ", (select(.version) | "`\(.version)`"), ( select(.optional) | "| `\(.optional)`" ) ] | join(" ")) ),
135-
""
136-
])),
137-
"</details>",
138-
""
139-
];
140-
141-
def primary_buildpack(p): [
142-
id(p.primary),
143-
"**Digest**: <!-- DIGEST PLACEHOLDER -->",
144-
"",
145-
( select(p.buildpacks) | included_buildpackages(p.buildpacks) ),
146-
( select(p.primary.stacks) | stacks(p.primary.stacks) ),
147-
( select(p.primary.metadata."default-versions") | default_dependency_versions(p.primary.metadata."default-versions") ),
148-
( select(p.primary.metadata.dependencies) | dependencies(p.primary.metadata.dependencies) ),
149-
( select(p.primary.order) | order_groupings(p.primary.order) ),
150-
( select(p.buildpacks) | "---" ),
151-
""
152-
];
153-
154-
def nested_buildpack(b): [
155-
"<details>",
156-
"<summary>\(b.buildpack.name) \(b.buildpack.version)</summary>",
157-
"",
158-
id(b),
159-
"",
160-
( select(b.stacks) | stacks(b.stacks) ),
161-
( select(b.metadata."default-versions") | default_dependency_versions(b.metadata."default-versions") ),
162-
( select(b.metadata.dependencies) | dependencies(b.metadata.dependencies) ),
163-
( select(b.order) | order_groupings(b.order) ),
164-
"---",
165-
"",
166-
"</details>",
167-
""
168-
];
169-
170-
$PAYLOAD | [
171-
primary_buildpack(.),
172-
( select(.buildpacks) | [ .buildpacks | sort_by(.buildpack.name | ascii_downcase) | map(nested_buildpack(.)) ] ),
173-
"",
174-
"---",
175-
"",
176-
$RELEASE_BODY
177-
] | flatten | join("\n")
178-
' > "${HOME}"/body
179-
180-
gh api \
181-
--method PATCH \
182-
"/repos/:owner/:repo/releases/${RELEASE_ID}" \
183-
--field "tag_name=${RELEASE_TAG_NAME}" \
184-
--field "name=@${HOME}/name" \
185-
--field "body=@${HOME}/body"
186-
env:
187-
GITHUB_TOKEN: ${{ secrets.JAVA_GITHUB_TOKEN }}
188-
RELEASE_BODY: ${{ steps.release-drafter.outputs.body }}
189-
RELEASE_ID: ${{ steps.release-drafter.outputs.id }}
190-
RELEASE_NAME: ${{ steps.release-drafter.outputs.name }}
191-
RELEASE_TAG_NAME: ${{ steps.release-drafter.outputs.tag_name }}
18+
uses: docker://ghcr.io/paketo-buildpacks/actions/draft-release:main
19+
with:
20+
github_token: ${{ secrets.JAVA_GITHUB_TOKEN }}
21+
release_body: ${{ steps.release-drafter.outputs.body }}
22+
release_id: ${{ steps.release-drafter.outputs.id }}
23+
release_name: ${{ steps.release-drafter.outputs.name }}
24+
release_tag_name: ${{ steps.release-drafter.outputs.tag_name }}

.github/workflows/update-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on:
1515
- ubuntu-latest
1616
steps:
17-
- uses: actions/setup-go@v2
17+
- uses: actions/setup-go@v3
1818
with:
1919
go-version: "1.17"
2020
- name: Install octo
@@ -62,7 +62,7 @@ jobs:
6262
env:
6363
DESCRIPTOR: .github/pipeline-descriptor.yml
6464
GITHUB_TOKEN: ${{ secrets.JAVA_GITHUB_TOKEN }}
65-
- uses: peter-evans/create-pull-request@v3
65+
- uses: peter-evans/create-pull-request@v4
6666
with:
6767
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
6868
body: |-

0 commit comments

Comments
 (0)