99 runs-on :
1010 - ubuntu-latest
1111 steps :
12+ - name : Docker login gcr.io
13+ if : ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
14+ uses : docker/login-action@v3
15+ with :
16+ password : ${{ secrets.GCR_PUSH_BOT_JSON_KEY }}
17+ registry : gcr.io
18+ username : _json_key
1219 - name : Docker login docker.io
1320 if : ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
14- uses : docker/login-action@v2
21+ uses : docker/login-action@v3
1522 with :
16- password : ${{ secrets.INITIALIZ_BUILDPACKS_DOCKERHUB_PASSWORD }}
23+ password : ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_PASSWORD }}
1724 registry : docker.io
18- username : ${{ secrets.INITIALIZ_BUILDPACKS_DOCKERHUB_USERNAME }}
19- - uses : actions/setup-go@v4
25+ username : ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_USERNAME }}
26+ - uses : actions/setup-go@v5
2027 with :
21- go-version : " stable "
28+ go-version : " 1.23 "
2229 - name : Install create-package
2330 run : |
2431 #!/usr/bin/env bash
2532
2633 set -euo pipefail
2734
2835 go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest
29- - name : Install crane
30- run : |
31- #!/usr/bin/env bash
32-
33- set -euo pipefail
34-
35- echo "Installing crane ${CRANE_VERSION}"
36-
37- mkdir -p "${HOME}"/bin
38- echo "${HOME}/bin" >> "${GITHUB_PATH}"
39-
40- curl \
41- --show-error \
42- --silent \
43- --location \
44- "https://github.com/google/go-containerregistry/releases/download/v${CRANE_VERSION}/go-containerregistry_Linux_x86_64.tar.gz" \
45- | tar -C "${HOME}/bin" -xz crane
46- env :
47- CRANE_VERSION : 0.8.0
48- - name : Install pack
49- run : |
50- #!/usr/bin/env bash
51-
52- set -euo pipefail
53-
54- echo "Installing pack ${PACK_VERSION}"
55-
56- mkdir -p "${HOME}"/bin
57- echo "${HOME}/bin" >> "${GITHUB_PATH}"
58-
59- curl \
60- --location \
61- --show-error \
62- --silent \
63- "https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \
64- | tar -C "${HOME}"/bin -xz pack
65- env :
66- PACK_VERSION : 0.36.0
36+ -
uses :
buildpacks/github-actions/[email protected] 37+ with :
38+ crane-version : 0.19.1
39+ yj-version : 5.1.0
40+ -
uses :
buildpacks/github-actions/[email protected] 41+ with :
42+ pack-version : 0.34.2
6743 - name : Enable pack Experimental
6844 if : ${{ false }}
6945 run : |
7551
7652 mkdir -p "${HOME}"/.pack
7753 echo "experimental = true" >> "${HOME}"/.pack/config.toml
78- - uses : actions/checkout@v3
54+ - uses : actions/checkout@v4
7955 - if : ${{ false }}
80- uses : actions/cache@v3
56+ uses : actions/cache@v4
8157 with :
8258 key : ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }}
8359 path : |-
9167
9268 set -euo pipefail
9369
94- if [ -z " ${GITHUB_REF+set}" ]; then
95- echo "GITHUB_REF set to [${GITHUB_REF-<unset> }], but should never be empty or unset "
70+ if [[ ${GITHUB_REF:-} != "refs/"* ] ]; then
71+ echo "GITHUB_REF set to [${GITHUB_REF:- }], but that is unexpected. It should start with 'refs/*' "
9672 exit 255
9773 fi
9874
@@ -130,21 +106,23 @@ jobs:
130106
131107 if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then
132108 create-package \
133- --source ${SOURCE_PATH:-.} \
109+ --source " ${SOURCE_PATH:-.}" \
134110 --cache-location "${HOME}"/carton-cache \
135111 --destination "${HOME}"/buildpack \
136112 --include-dependencies \
137113 --version "${VERSION}"
138114 else
139115 create-package \
140- --source ${SOURCE_PATH:-.} \
116+ --source " ${SOURCE_PATH:-.}" \
141117 --destination "${HOME}"/buildpack \
142118 --version "${VERSION}"
143119 fi
144120
145- PACKAGE_FILE=${SOURCE_PATH:-.}/package.toml
146- [[ -e ${PACKAGE_FILE} ]] && cp ${PACKAGE_FILE} "${HOME}"/package.toml
147- printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}"/buildpack "${OS}" >> "${HOME}"/package.toml
121+ PACKAGE_FILE="${SOURCE_PATH:-.}/package.toml"
122+ if [ -f "${PACKAGE_FILE}" ]; then
123+ cp "${PACKAGE_FILE}" "${HOME}/buildpack/package.toml"
124+ printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}/buildpack" "${OS}" >> "${HOME}/buildpack/package.toml"
125+ fi
148126 env :
149127 INCLUDE_DEPENDENCIES : " false"
150128 OS : linux
@@ -157,15 +135,23 @@ jobs:
157135
158136 set -euo pipefail
159137
138+ COMPILED_BUILDPACK="${HOME}/buildpack"
139+
140+ # create-package puts the buildpack here, we need to run from that directory
141+ # for component buildpacks so that pack doesn't need a package.toml
142+ cd "${COMPILED_BUILDPACK}"
143+ CONFIG=""
144+ if [ -f "${COMPILED_BUILDPACK}/package.toml" ]; then
145+ CONFIG="--config ${COMPILED_BUILDPACK}/package.toml"
146+ fi
160147
161148 PACKAGE_LIST=($PACKAGES)
162149 # Extract first repo (Docker Hub) as the main to package & register
163150 PACKAGE=${PACKAGE_LIST[0]}
164151
165152 if [[ "${PUBLISH:-x}" == "true" ]]; then
166- pack buildpack package \
167- "${PACKAGE}:${VERSION}" \
168- --config "${HOME}"/package.toml \
153+ pack -v buildpack package \
154+ "${PACKAGE}:${VERSION}" ${CONFIG} \
169155 --publish
170156
171157 if [[ -n ${VERSION_MINOR:-} && -n ${VERSION_MAJOR:-} ]]; then
@@ -189,13 +175,12 @@ jobs:
189175 done
190176
191177 else
192- pack buildpack package \
193- "${PACKAGE}:${VERSION}" \
194- --config "${HOME}"/package.toml \
195- --format "${FORMAT}"
178+ pack -v buildpack package \
179+ "${PACKAGE}:${VERSION}" ${CONFIG} \
180+ --format "${FORMAT}" $([ -n "$TTL_SH_PUBLISH" ] && [ "$TTL_SH_PUBLISH" = "true" ] && echo "--publish")
196181 fi
197182 env :
198- PACKAGES : docker.io/initializbuildpacks /watchexec docker .io/initializbuildpacks /watchexec
183+ PACKAGES : docker.io/paketobuildpacks /watchexec gcr .io/paketo-buildpacks /watchexec
199184 PUBLISH : " true"
200185 VERSION : ${{ steps.version.outputs.version }}
201186 VERSION_MAJOR : ${{ steps.version.outputs.version-major }}
@@ -221,11 +206,11 @@ jobs:
221206 --field "body=${RELEASE_BODY//<!-- DIGEST PLACEHOLDER -->/\`${DIGEST}\`}"
222207 env :
223208 DIGEST : ${{ steps.package.outputs.digest }}
224- GITHUB_TOKEN : ${{ secrets.PAT }}
209+ GITHUB_TOKEN : ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
225210 - if : ${{ true }}
226- uses : docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.0.1
211+ uses : docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.7.2
227212 with :
228- address : docker.io/initializbuildpacks /watchexec@${{ steps.package.outputs.digest }}
213+ address : docker.io/paketobuildpacks /watchexec@${{ steps.package.outputs.digest }}
229214 id : initializ-buildpacks/watchexec
230- token : ${{ secrets.PAT }}
215+ token : ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
231216 version : ${{ steps.version.outputs.version }}
0 commit comments