Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates github-config #23

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ updates:
update-types:
- "minor"
- "patch"
exclude-patterns:
- "github.com/anchore/stereoscope"
- "github.com/testcontainers/testcontainers-go"
- "github.com/docker/docker"
- "github.com/containerd/containerd"
2 changes: 1 addition & 1 deletion .github/workflows/publish-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
issue_body: |
Publish All Draft Releases workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
comment_body: |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

Check failure on line 41 in .github/workflows/publish-releases.yml

View workflow job for this annotation

GitHub Actions / lintYaml

41:113 [new-line-at-end-of-file] no new line character at the end of file
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ jobs:
issue_body: |
Update Go Mod Version workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
comment_body: |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
6 changes: 3 additions & 3 deletions scripts/.util/tools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"createpackage": "v1.69.1",
"createpackage": "v1.70.0",
"jam": "v2.7.2",
"pack": "v0.33.2"
}
"pack": "v0.34.2"
}
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function run::build() {

names=("detect")

if [ -f "extension.toml" ]; then
if [ -f "${BUILDPACKDIR}/extension.toml" ]; then
names+=("generate")
else
names+=("build")
Expand Down
49 changes: 36 additions & 13 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,25 @@ function main {

tools::install "${token}"

buildpack::archive "${version}"
buildpackage::create "${output}"
buildpack_type=buildpack
if [ -f "${ROOT_DIR}/extension.toml" ]; then
buildpack_type=extension
fi

buildpack::archive "${version}" "${buildpack_type}"
buildpackage::create "${output}" "${buildpack_type}"
}

function usage() {
cat <<-USAGE
package.sh --version <version> [OPTIONS]

Packages the buildpack into a buildpackage .cnb file.
Packages a buildpack or an extension into a buildpackage .cnb file.

OPTIONS
--help -h prints the command usage
--version <version> -v <version> specifies the version number to use when packaging the buildpack
--output <output> -o <output> location to output the packaged buildpackage artifact (default: ${ROOT_DIR}/build/buildpackage.cnb)
--version <version> -v <version> specifies the version number to use when packaging a buildpack or an extension
--output <output> -o <output> location to output the packaged buildpackage or extension artifact (default: ${ROOT_DIR}/build/buildpackage.cnb)
--token <token> Token used to download assets from GitHub (e.g. jam, pack, etc) (optional)
USAGE
}
Expand Down Expand Up @@ -114,8 +119,9 @@ function tools::install() {
function buildpack::archive() {
local version
version="${1}"
buildpack_type="${2}"

util::print::title "Packaging buildpack into ${BUILD_DIR}/buildpack.tgz..."
util::print::title "Packaging ${buildpack_type} into ${BUILD_DIR}/buildpack.tgz..."

if [[ -f "${ROOT_DIR}/.libbuildpack" ]]; then
packager \
Expand All @@ -125,7 +131,7 @@ function buildpack::archive() {
"${BUILD_DIR}/buildpack"
else
jam pack \
--buildpack "${ROOT_DIR}/buildpack.toml" \
"--${buildpack_type}" "${ROOT_DIR}/${buildpack_type}.toml"\
--version "${version}" \
--output "${BUILD_DIR}/buildpack.tgz"
fi
Expand All @@ -134,13 +140,30 @@ function buildpack::archive() {
function buildpackage::create() {
local output
output="${1}"
buildpack_type="${2}"

util::print::title "Packaging ${buildpack_type}... ${output}"

util::print::title "Packaging buildpack..."
if [ "$buildpack_type" == "extension" ]; then
cwd=$(pwd)
cd ${BUILD_DIR}
mkdir cnbdir
cd cnbdir
cp ../buildpack.tgz .
tar -xvf buildpack.tgz
rm buildpack.tgz

pack \
buildpack package "${output}" \
--path "${BUILD_DIR}/buildpack.tgz" \
--format file
pack \
extension package "${output}" \
--format file

cd $cwd
else
pack \
buildpack package "${output}" \
--path "${BUILD_DIR}/buildpack.tgz" \
--format file
fi
}

main "${@:-}"
main "${@:-}"
Loading