Skip to content

Commit

Permalink
Merge pull request #1 from initializ-buildpacks/automations/github-co…
Browse files Browse the repository at this point in the history
…nfig/update

Updates github-config
  • Loading branch information
Vivek Yadav authored May 3, 2024
2 parents ce38754 + 97c6e54 commit 254a929
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 37 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/approve-bot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
repo: ${{ github.repository }}
run_id: ${{ github.event.workflow_run.id }}
workspace: "/github/workspace"
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
- id: pr-data
run: |
echo "author=$(cat event.json | jq -r '.pull_request.user.login')" >> "$GITHUB_OUTPUT"
Expand All @@ -38,15 +38,15 @@ jobs:
id: unverified-commits
uses: initializ-buildpacks/github-config/actions/pull-request/check-unverified-commits@main
with:
token: ${{ secrets.INITIALIZ_BOT_REVIEWER_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
repo: ${{ github.repository }}
number: ${{ needs.download.outputs.pr-number }}

- name: Check for Human Commits
id: human-commits
uses: initializ-buildpacks/github-config/actions/pull-request/check-human-commits@main
with:
token: ${{ secrets.INITIALIZ_BOT_REVIEWER_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
repo: ${{ github.repository }}
number: ${{ needs.download.outputs.pr-number }}

Expand All @@ -58,12 +58,12 @@ jobs:
if: steps.human-commits.outputs.human_commits == 'false' && steps.unverified-commits.outputs.unverified_commits == 'false'
uses: initializ-buildpacks/github-config/actions/pull-request/approve@main
with:
token: ${{ secrets.INITIALIZ_BOT_REVIEWER_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
number: ${{ needs.download.outputs.pr-number }}

- name: Enable Auto-Merge
if: steps.human-commits.outputs.human_commits == 'false' && steps.unverified-commits.outputs.unverified_commits == 'false'
run: |
gh pr merge ${{ needs.download.outputs.pr-number }} --auto --rebase
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
4 changes: 2 additions & 2 deletions .github/workflows/create-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ jobs:
uses: initializ-buildpacks/github-config/actions/release/notes@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
- name: Create Release
uses: initializ-buildpacks/github-config/actions/release/create@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
tag_name: v${{ steps.tag.outputs.tag }}
target_commitish: ${{ github.sha }}
name: v${{ steps.tag.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
if: ${{ failure() }}
uses: initializ-buildpacks/github-config/actions/pull-request/auto-semver-label@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
17 changes: 6 additions & 11 deletions .github/workflows/push-buildpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
types:
- published

permissions:
id-token: write
contents: read

jobs:
push:
name: Push
Expand All @@ -28,7 +32,7 @@ jobs:
with:
url: ${{ steps.event.outputs.download_url }}
output: "/github/workspace/buildpackage.cnb"
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}

- name: Validate version
run: |
Expand All @@ -39,15 +43,6 @@ jobs:
exit 1
fi
- name: Push to GCR
env:
GCR_PUSH_BOT_JSON_KEY: ${{ secrets.GCR_PUSH_BOT_JSON_KEY }}
run: |
echo "${GCR_PUSH_BOT_JSON_KEY}" | sudo skopeo login --username _json_key --password-stdin gcr.io
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag_full }}"
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag_minor }}"
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag_major }}"
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:latest"
- name: Push to DockerHub
id: push
Expand All @@ -72,7 +67,7 @@ jobs:
id: ${{ github.repository }}
version: ${{ steps.event.outputs.tag_full }}
address: ${{ steps.push.outputs.image }}@${{ steps.push.outputs.digest }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}

failure:
name: Alert on Failure
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-github-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: initializ-buildpacks/github-config/actions/pull-request/open@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
title: "Updates github-config"
branch: automations/github-config/update

Expand All @@ -70,7 +70,7 @@ jobs:
- name: File Failure Alert Issue
uses: initializ-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
label: "failure:update-github-config"
comment_if_exists: true
Expand Down
2 changes: 1 addition & 1 deletion scripts/.util/builders.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function util::builders::list() {

if [[ -z "${builders}" ]]; then
util::print::info "No builders specified. Falling back to default builder..."
builders="$(jq --compact-output --null-input '["index.docker.io/paketobuildpacks/builder-jammy-buildpackless-base:latest"]')"
builders="$(jq --compact-output --null-input '["index.docker.io/initializbuildpacks/securepacks-initzbuilder:latest"]')"
fi

echo "${builders}"
Expand Down
8 changes: 4 additions & 4 deletions scripts/.util/tools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"createpackage": "v1.68.0",
"jam": "v2.7.0",
"pack": "v0.32.1"
}
"createpackage": "v1.69.1",
"jam": "v2.7.2",
"pack": "v0.33.2"
}
13 changes: 12 additions & 1 deletion scripts/.util/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ function util::tools::pack::install() {

version="$(jq -r .pack "$(dirname "${BASH_SOURCE[0]}")/tools.json")"

local pack_config_enable_experimental
if [ -f "$(dirname "${BASH_SOURCE[0]}")/../options.json" ]; then
pack_config_enable_experimental="$(jq -r .pack_config_enable_experimental "$(dirname "${BASH_SOURCE[0]}")/../options.json")"
else
pack_config_enable_experimental="false"
fi

tmp_location="/tmp/pack.tgz"
curl_args=(
"--fail"
Expand All @@ -158,6 +165,10 @@ function util::tools::pack::install() {
tar xzf "${tmp_location}" -C "${dir}"
chmod +x "${dir}/pack"

if [[ "${pack_config_enable_experimental}" == "true" ]]; then
"${dir}"/pack config experimental true
fi

rm "${tmp_location}"
else
util::print::info "Using pack $("${dir}"/pack version)"
Expand Down Expand Up @@ -224,4 +235,4 @@ function util::tools::tests::checkfocus() {
util::print::success "** GO Test Succeeded **" 197
fi
rm "${testout}"
}
}
32 changes: 22 additions & 10 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ function run::build() {

echo "Success!"

for name in detect build; do
names=("detect")

if [ -f "extension.toml" ]; then
names+=("generate")
else
names+=("build")
fi

for name in "${names[@]}"; do
printf "%s" "Linking ${name}... "

ln -sf "run" "${name}"
Expand All @@ -73,18 +81,22 @@ function cmd::build() {
for src in "${BUILDPACKDIR}"/cmd/*; do
name="$(basename "${src}")"

printf "%s" "Building ${name}... "
if [[ -f "${src}/main.go" ]]; then
printf "%s" "Building ${name}... "

GOOS="linux" \
CGO_ENABLED=0 \
go build \
-ldflags="-s -w" \
-o "${BUILDPACKDIR}/bin/${name}" \
"${src}/main.go"
GOOS="linux" \
CGO_ENABLED=0 \
go build \
-ldflags="-s -w" \
-o "${BUILDPACKDIR}/bin/${name}" \
"${src}/main.go"

echo "Success!"
echo "Success!"
else
printf "%s" "Skipping ${name}... "
fi
done
fi
}

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

0 comments on commit 254a929

Please sign in to comment.