Skip to content

Commit

Permalink
Merge pull request #1 from initializ-buildpacks/automation/github-con…
Browse files Browse the repository at this point in the history
…fig/update

Updates github-config
  • Loading branch information
Naveen-is-here authored May 15, 2024
2 parents 8e1c2d9 + da23488 commit b338379
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 106 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/approve-bot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
pr-number: ${{ steps.pr-data.outputs.number }}
steps:
- name: 'Download artifact'
uses: paketo-buildpacks/github-config/actions/pull-request/download-artifact@main
uses: initializ-buildpacks/github-config/actions/pull-request/download-artifact@main
with:
name: "event-payload"
repo: ${{ github.repository }}
run_id: ${{ github.event.workflow_run.id }}
workspace: "/github/workspace"
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
- id: pr-data
run: |
echo "author=$(cat event.json | jq -r '.pull_request.user.login')" >> "$GITHUB_OUTPUT"
Expand All @@ -31,22 +31,22 @@ jobs:
approve:
name: Approve Bot PRs
needs: download
if: ${{ needs.download.outputs.pr-author == 'paketo-bot' || needs.download.outputs.pr-author == 'dependabot[bot]' }}
if: ${{ needs.download.outputs.pr-author == 'initializ-bot' || needs.download.outputs.pr-author == 'dependabot[bot]' }}
runs-on: ubuntu-22.04
steps:
- name: Check Commit Verification
id: unverified-commits
uses: paketo-buildpacks/github-config/actions/pull-request/check-unverified-commits@main
uses: initializ-buildpacks/github-config/actions/pull-request/check-unverified-commits@main
with:
token: ${{ secrets.PAKETO_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: paketo-buildpacks/github-config/actions/pull-request/check-human-commits@main
uses: initializ-buildpacks/github-config/actions/pull-request/check-human-commits@main
with:
token: ${{ secrets.PAKETO_BOT_REVIEWER_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
repo: ${{ github.repository }}
number: ${{ needs.download.outputs.pr-number }}

Expand All @@ -56,14 +56,14 @@ jobs:

- name: Approve
if: steps.human-commits.outputs.human_commits == 'false' && steps.unverified-commits.outputs.unverified_commits == 'false'
uses: paketo-buildpacks/github-config/actions/pull-request/approve@main
uses: initializ-buildpacks/github-config/actions/pull-request/approve@main
with:
token: ${{ secrets.PAKETO_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.PAKETO_BOT_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
27 changes: 13 additions & 14 deletions .github/workflows/create-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 'stable'
- name: Checkout
uses: actions/checkout@v3
- name: Run Unit Tests
Expand All @@ -49,14 +49,12 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 'stable'
- name: Checkout
uses: actions/checkout@v3
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
- name: Run Integration Tests
run: ./scripts/integration.sh --use-token --builder ${{ matrix.builder }}
run: ./scripts/integration.sh --builder ${{ matrix.builder }} --token ${{ github.token }}
env:
GIT_TOKEN: ${{ github.token }}
TMPDIR: "${{ runner.temp }}"

release:
Expand All @@ -67,20 +65,21 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 'stable'
- name: Checkout
uses: actions/checkout@v3
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
with:
fetch-tags: true
- name: Reset Draft Release
id: reset
uses: paketo-buildpacks/github-config/actions/release/reset-draft@main
uses: initializ-buildpacks/github-config/actions/release/reset-draft@main
with:
repo: ${{ github.repository }}
token: ${{ github.token }}
- name: Calculate Semver Tag
if: github.event.inputs.version == ''
id: semver
uses: paketo-buildpacks/github-config/actions/tag/calculate-semver@main
uses: initializ-buildpacks/github-config/actions/tag/calculate-semver@main
with:
repo: ${{ github.repository }}
token: ${{ github.token }}
Expand All @@ -97,15 +96,15 @@ jobs:
run: ./scripts/package.sh --version "${{ steps.tag.outputs.tag }}"
- name: Create Release Notes
id: create-release-notes
uses: paketo-buildpacks/github-config/actions/release/notes@main
uses: initializ-buildpacks/github-config/actions/release/notes@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
- name: Create Release
uses: paketo-buildpacks/github-config/actions/release/create@main
uses: initializ-buildpacks/github-config/actions/release/create@main
with:
repo: ${{ github.repository }}
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
tag_name: v${{ steps.tag.outputs.tag }}
target_commitish: ${{ github.sha }}
name: v${{ steps.tag.outputs.tag }}
Expand All @@ -132,7 +131,7 @@ jobs:
if: ${{ always() && needs.unit.result == 'failure' || needs.integration.result == 'failure' || needs.release.result == 'failure' }}
steps:
- name: File Failure Alert Issue
uses: paketo-buildpacks/github-config/actions/issue/file@main
uses: initializ-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:

- name: Auto-label Semver
if: ${{ failure() }}
uses: paketo-buildpacks/github-config/actions/pull-request/auto-semver-label@main
uses: initializ-buildpacks/github-config/actions/pull-request/auto-semver-label@main
env:
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/lint-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Checkout github-config
uses: actions/checkout@v3
with:
repository: paketo-buildpacks/github-config
repository: initializ-buildpacks/github-config
path: github-config

- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 'stable'

- name: Checkout
uses: actions/checkout@v3
Expand Down
27 changes: 11 additions & 16 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 @@ -24,11 +28,11 @@ jobs:
- name: Download
id: download
uses: paketo-buildpacks/github-config/actions/release/download-asset@main
uses: initializ-buildpacks/github-config/actions/release/download-asset@main
with:
url: ${{ steps.event.outputs.download_url }}
output: "/github/workspace/buildpackage.cnb"
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}

- name: Validate version
run: |
Expand All @@ -39,24 +43,15 @@ 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
env:
DOCKERHUB_USERNAME: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.INITIALIZ_BUILDPACKS_DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.INITIALIZ_BUILDPACKS_DOCKERHUB_PASSWORD }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
run: |
REPOSITORY="${GITHUB_REPOSITORY_OWNER/-/}/${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" # translates 'paketo-buildpacks/bundle-install' to 'paketobuildpacks/bundle-install'
REPOSITORY="${GITHUB_REPOSITORY_OWNER/-/}/${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" # translates 'initializ-buildpacks/bundle-install' to 'initializbuildpacks/bundle-install'
IMAGE="index.docker.io/${REPOSITORY}"
echo "${DOCKERHUB_PASSWORD}" | sudo skopeo login --username "${DOCKERHUB_USERNAME}" --password-stdin index.docker.io
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${IMAGE}:${{ steps.event.outputs.tag_full }}"
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.PAKETO_BOT_GITHUB_TOKEN }}
token: ${{ secrets.PAT }}

failure:
name: Alert on Failure
Expand All @@ -81,7 +76,7 @@ jobs:
if: ${{ always() && needs.push.result == 'failure' }}
steps:
- name: File Failure Alert Issue
uses: paketo-buildpacks/github-config/actions/issue/file@main
uses: initializ-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 'stable'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -49,17 +49,14 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 'stable'

- name: Checkout
uses: actions/checkout@v3

- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true

- name: Run Integration Tests
run: ./scripts/integration.sh --use-token --builder ${{ matrix.builder }}
run: ./scripts/integration.sh --builder ${{ matrix.builder }} --token ${{ github.token }}
env:
GIT_TOKEN: ${{ github.token }}
TMPDIR: "${{ runner.temp }}"

roundup:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-github-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Checkout Branch
uses: initializ-buildpacks/github-config/actions/pull-request/checkout-branch@main
with:
branch: automation/github-config/update
branch: automations/github-config/update

- name: Run the sync action
uses: initializ-buildpacks/github-config/actions/sync@main
Expand All @@ -51,15 +51,15 @@ jobs:
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: initializ-buildpacks/github-config/actions/pull-request/push-branch@main
with:
branch: automation/github-config/update
branch: automations/github-config/update

- name: Open Pull Request
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: initializ-buildpacks/github-config/actions/pull-request/open@main
with:
token: ${{ secrets.PAT }}
title: "Updates github-config"
branch: automation/github-config/update
branch: automations/github-config/update

failure:
name: Alert on Failure
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
21 changes: 0 additions & 21 deletions scripts/.util/git.sh

This file was deleted.

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.67.1",
"jam": "v2.6.0",
"pack": "v0.31.0"
}
"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}"
}
}
Loading

0 comments on commit b338379

Please sign in to comment.