Skip to content

Commit

Permalink
Remove pack exp for now
Browse files Browse the repository at this point in the history
* it'll come via official pipeline builder release
  • Loading branch information
anthonydahanne committed Mar 27, 2024
1 parent 206da3b commit 76fc0d8
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 78 deletions.
103 changes: 44 additions & 59 deletions .github/workflows/pb-create-package.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Create Package
"on":
push:
branches:
- dualarch-experiment
release:
types:
- published
jobs:
create-package:
name: Create Package
Expand Down Expand Up @@ -37,20 +37,9 @@ jobs:
with:
crane-version: 0.19.0
yj-version: 5.1.0
- name: Install pack
run: |
#!/usr/bin/env bash
# this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box
# TODO to revisit when the official one is out
set -euo pipefail
echo "Installing pack experimental"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack
chmod +x "${HOME}"/bin/pack
- uses: buildpacks/github-actions/[email protected]
with:
pack-version: 0.33.2
- name: Enable pack Experimental
if: ${{ false }}
run: |
Expand Down Expand Up @@ -144,20 +133,15 @@ jobs:
set -euo pipefail
CONFIG="--config "${HOME}"/package.toml"
#TODO with this, we don't need to use the package.toml, because pack exp. does not support it with multi arch yet
if ! [ -f "${PWD}/package.toml" ]; then
cd ~/buildpack
CONFIG=""
fi
PACKAGE_LIST=($PACKAGES)
# Extract first repo (Docker Hub) as the main to package & register
PACKAGE=${PACKAGE_LIST[0]}
if [[ "${PUBLISH:-x}" == "true" ]]; then
pack -v buildpack package \
"${PACKAGE}:${VERSION}" ${CONFIG} \
pack buildpack package \
"${PACKAGE}:${VERSION}" \
--config "${HOME}"/package.toml \
--publish
if [[ -n ${VERSION_MINOR:-} && -n ${VERSION_MAJOR:-} ]]; then
Expand All @@ -181,42 +165,43 @@ jobs:
done
else
pack -v buildpack package \
"${PACKAGE}:${VERSION}" ${CONFIG} \
pack buildpack package \
"${PACKAGE}:${VERSION}" \
--config "${HOME}"/package.toml \
--format "${FORMAT}"
fi
env:
PACKAGES: docker.io/paketobuildpacks/procfile gcr.io/paketo-buildpacks/procfile
PUBLISH: "true"
VERSION: dualarch-experiment-mar15
VERSION_MAJOR: dual-mar15
VERSION_MINOR: arch-mar15
# - name: Update release with digest
# run: |
# #!/usr/bin/env bash
#
# set -euo pipefail
#
# PAYLOAD=$(cat "${GITHUB_EVENT_PATH}")
#
# RELEASE_ID=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.id')
# RELEASE_TAG_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.tag_name')
# RELEASE_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.name')
# RELEASE_BODY=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.body')
#
# gh api \
# --method PATCH \
# "/repos/:owner/:repo/releases/${RELEASE_ID}" \
# --field "tag_name=${RELEASE_TAG_NAME}" \
# --field "name=${RELEASE_NAME}" \
# --field "body=${RELEASE_BODY//<!-- DIGEST PLACEHOLDER -->/\`${DIGEST}\`}"
# env:
# DIGEST: ${{ steps.package.outputs.digest }}
# GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
# - if: ${{ true }}
# uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.0.1
# with:
# address: docker.io/paketobuildpacks/procfile@${{ steps.package.outputs.digest }}
# id: paketo-buildpacks/procfile
# token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
# version: ${{ steps.version.outputs.version }}
VERSION: ${{ steps.version.outputs.version }}
VERSION_MAJOR: ${{ steps.version.outputs.version-major }}
VERSION_MINOR: ${{ steps.version.outputs.version-minor }}
- name: Update release with digest
run: |
#!/usr/bin/env bash
set -euo pipefail
PAYLOAD=$(cat "${GITHUB_EVENT_PATH}")
RELEASE_ID=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.id')
RELEASE_TAG_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.tag_name')
RELEASE_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.name')
RELEASE_BODY=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.body')
gh api \
--method PATCH \
"/repos/:owner/:repo/releases/${RELEASE_ID}" \
--field "tag_name=${RELEASE_TAG_NAME}" \
--field "name=${RELEASE_NAME}" \
--field "body=${RELEASE_BODY//<!-- DIGEST PLACEHOLDER -->/\`${DIGEST}\`}"
env:
DIGEST: ${{ steps.package.outputs.digest }}
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
- if: ${{ true }}
uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.0.1
with:
address: docker.io/paketobuildpacks/procfile@${{ steps.package.outputs.digest }}
id: paketo-buildpacks/procfile
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
version: ${{ steps.version.outputs.version }}
16 changes: 6 additions & 10 deletions .github/workflows/pb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,15 @@ jobs:
set -euo pipefail
CONFIG="--config "${HOME}"/package.toml"
#TODO with this, we don't need to use the package.toml, because pack exp. does not support it with multi arch yet
if ! [ -f "${PWD}/package.toml" ]; then
cd ~/buildpack
CONFIG=""
fi
PACKAGE_LIST=($PACKAGES)
# Extract first repo (Docker Hub) as the main to package & register
PACKAGE=${PACKAGE_LIST[0]}
if [[ "${PUBLISH:-x}" == "true" ]]; then
pack -v buildpack package \
"${PACKAGE}:${VERSION}" ${CONFIG} \
pack buildpack package \
"${PACKAGE}:${VERSION}" \
--config "${HOME}"/package.toml \
--publish
if [[ -n ${VERSION_MINOR:-} && -n ${VERSION_MAJOR:-} ]]; then
Expand All @@ -155,8 +150,9 @@ jobs:
done
else
pack -v buildpack package \
"${PACKAGE}:${VERSION}" ${CONFIG} \
pack buildpack package \
"${PACKAGE}:${VERSION}" \
--config "${HOME}"/package.toml \
--format "${FORMAT}"
fi
env:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

bin/
linux/
dependencies/
package/
scratch/
16 changes: 8 additions & 8 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

set -euo pipefail

GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/main github.com/paketo-buildpacks/procfile/v5/cmd/main
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main github.com/paketo-buildpacks/procfile/v5/cmd/main
GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/procfile/v5/cmd/main
GOOS="windows" GOARCH="amd64" go build -ldflags='-s -w' -o bin/main.exe github.com/paketo-buildpacks/procfile/v5/cmd/main

if [ "${STRIP:-false}" != "false" ]; then
strip linux/amd64/bin/main linux/arm64/bin/main
strip bin/main bin/main.exe
fi

if [ "${COMPRESS:-none}" != "none" ]; then
$COMPRESS linux/amd64/bin/main linux/arm64/bin/main
$COMPRESS bin/main bin/main.exe
fi

ln -fs main linux/amd64/bin/build
ln -fs main linux/arm64/bin/build
ln -fs main linux/amd64/bin/detect
ln -fs main linux/arm64/bin/detect
ln -fs main bin/build
ln -fs main bin/detect
ln -fs main.exe bin/build.exe
ln -fs main.exe bin/detect.exe

0 comments on commit 76fc0d8

Please sign in to comment.