diff --git a/.github/workflows/approve-bot-pr.yml b/.github/workflows/approve-bot-pr.yml deleted file mode 100644 index c798e647..00000000 --- a/.github/workflows/approve-bot-pr.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Approve Bot PRs and Enable Auto-Merge - -on: - workflow_run: - workflows: ["Test Pull Request"] - types: - - completed - -jobs: - download: - name: Download PR Artifact - if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-22.04 - outputs: - pr-author: ${{ steps.pr-data.outputs.author }} - pr-number: ${{ steps.pr-data.outputs.number }} - steps: - - name: 'Download artifact' - uses: paketo-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 }} - - id: pr-data - run: | - echo "author=$(cat event.json | jq -r '.pull_request.user.login')" >> "$GITHUB_OUTPUT" - echo "number=$(cat event.json | jq -r '.pull_request.number')" >> "$GITHUB_OUTPUT" - - approve: - name: Approve Bot PRs - needs: download - if: ${{ needs.download.outputs.pr-author == 'paketo-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 - with: - token: ${{ secrets.PAKETO_BOT_REVIEWER_GITHUB_TOKEN }} - 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 - with: - token: ${{ secrets.PAKETO_BOT_REVIEWER_GITHUB_TOKEN }} - repo: ${{ github.repository }} - number: ${{ needs.download.outputs.pr-number }} - - - name: Checkout - if: steps.human-commits.outputs.human_commits == 'false' && steps.unverified-commits.outputs.unverified_commits == 'false' - uses: actions/checkout@v3 - - - 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 - with: - token: ${{ secrets.PAKETO_BOT_REVIEWER_GITHUB_TOKEN }} - 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 }} diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 281809f6..6d7780c4 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -100,12 +100,12 @@ jobs: uses: paketo-buildpacks/github-config/actions/release/notes@main with: repo: ${{ github.repository }} - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + token: ${{ secrets.NINE_BOT_GITHUB_TOKEN }} - name: Create Release uses: paketo-buildpacks/github-config/actions/release/create@main with: repo: ${{ github.repository }} - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + token: ${{ secrets.NINE_BOT_GITHUB_TOKEN }} tag_name: v${{ steps.tag.outputs.tag }} target_commitish: ${{ github.sha }} name: v${{ steps.tag.outputs.tag }} @@ -124,22 +124,3 @@ jobs: "content_type": "application/gzip" } ] - - failure: - name: Alert on Failure - runs-on: ubuntu-22.04 - needs: [ unit, integration, release ] - 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 - with: - token: ${{ secrets.GITHUB_TOKEN }} - repo: ${{ github.repository }} - label: "failure:release" - comment_if_exists: true - issue_title: "Failure: Create Draft Release workflow" - issue_body: | - Create Draft Release 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}} diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml deleted file mode 100644 index b09cdf09..00000000 --- a/.github/workflows/label-pr.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Set / Validate PR Labels -on: - pull_request_target: - branches: - - main - types: - - synchronize - - opened - - reopened - - labeled - - unlabeled - -concurrency: pr_labels_${{ github.event.number }} - -jobs: - autolabel: - name: Ensure Minimal Semver Labels - runs-on: ubuntu-22.04 - steps: - - name: Check Minimal Semver Labels - uses: mheap/github-action-required-labels@v3 - with: - count: 1 - labels: semver:major, semver:minor, semver:patch - mode: exactly - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Auto-label Semver - if: ${{ failure() }} - uses: paketo-buildpacks/github-config/actions/pull-request/auto-semver-label@main - env: - GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/push-buildpackage.yml b/.github/workflows/push-buildpackage.yml index f96478ec..c92c5c45 100644 --- a/.github/workflows/push-buildpackage.yml +++ b/.github/workflows/push-buildpackage.yml @@ -5,6 +5,10 @@ on: types: - published +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + jobs: push: name: Push @@ -28,7 +32,7 @@ jobs: with: url: ${{ steps.event.outputs.download_url }} output: "/github/workspace/buildpackage.cnb" - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + token: ${{ secrets.NINE_BOT_GITHUB_TOKEN }} - name: Validate version run: | @@ -39,56 +43,10 @@ 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 }} - GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} + - name: Push to GHCR run: | - REPOSITORY="${GITHUB_REPOSITORY_OWNER/-/}/${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" # translates 'paketo-buildpacks/bundle-install' to 'paketobuildpacks/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 }}" - sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${IMAGE}:${{ steps.event.outputs.tag_minor }}" - sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${IMAGE}:${{ steps.event.outputs.tag_major }}" - sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${IMAGE}:latest" - echo "image=${IMAGE}" >> "$GITHUB_OUTPUT" - echo "digest=$(sudo skopeo inspect "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" | jq -r .Digest)" >> "$GITHUB_OUTPUT" - - - name: Register with CNB Registry - uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:main - with: - id: ${{ github.repository }} - version: ${{ steps.event.outputs.tag_full }} - address: ${{ steps.push.outputs.image }}@${{ steps.push.outputs.digest }} - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - - failure: - name: Alert on Failure - runs-on: ubuntu-22.04 - needs: [push] - if: ${{ always() && needs.push.result == 'failure' }} - steps: - - name: File Failure Alert Issue - uses: paketo-buildpacks/github-config/actions/issue/file@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - repo: ${{ github.repository }} - label: "failure:push" - comment_if_exists: true - issue_title: "Failure: Push Buildpackage workflow" - issue_body: | - Push Buildpackage 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}} + sudo skopeo login --username ${{ github.actor }} --password "${{ secrets.GITHUB_TOKEN }}" "${{ env.REGISTRY }}" + sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.event.outputs.tag_full }}" + sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.event.outputs.tag_minor }}" + sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.event.outputs.tag_major }}" + sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" diff --git a/.github/workflows/synchronize-labels.yml b/.github/workflows/synchronize-labels.yml deleted file mode 100644 index 3aaa0177..00000000 --- a/.github/workflows/synchronize-labels.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Synchronize Labels -"on": - push: - branches: - - main - paths: - - .github/labels.yml - workflow_dispatch: {} -jobs: - synchronize: - name: Synchronize Labels - runs-on: - - ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: micnncim/action-label-syncer@v1 - env: - GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/update-github-config.yml b/.github/workflows/update-github-config.yml deleted file mode 100644 index 79164ac6..00000000 --- a/.github/workflows/update-github-config.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Update shared github-config - -on: - schedule: - - cron: '27 13 * * *' # daily at 13:27 UTC - workflow_dispatch: {} - -concurrency: github_config_update - -jobs: - build: - name: Create PR to update shared files - runs-on: ubuntu-22.04 - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - - - name: Checkout github-config - uses: actions/checkout@v3 - with: - repository: paketo-buildpacks/github-config - path: github-config - - - name: Checkout Branch - uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main - with: - branch: automation/github-config/update - - - name: Run the sync action - uses: paketo-buildpacks/github-config/actions/sync@main - with: - workspace: /github/workspace - config: /github/workspace/github-config/implementation - - - name: Cleanup - run: rm -rf github-config - - - name: Commit - id: commit - uses: paketo-buildpacks/github-config/actions/pull-request/create-commit@main - with: - message: "Updating github-config" - pathspec: "." - keyid: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY_ID }} - key: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY }} - - - name: Push Branch - if: ${{ steps.commit.outputs.commit_sha != '' }} - uses: paketo-buildpacks/github-config/actions/pull-request/push-branch@main - with: - branch: automation/github-config/update - - - name: Open Pull Request - if: ${{ steps.commit.outputs.commit_sha != '' }} - uses: paketo-buildpacks/github-config/actions/pull-request/open@main - with: - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - title: "Updates github-config" - branch: automation/github-config/update - - failure: - name: Alert on Failure - runs-on: ubuntu-22.04 - needs: [build] - if: ${{ always() && needs.build.result == 'failure' }} - steps: - - name: File Failure Alert Issue - uses: paketo-buildpacks/github-config/actions/issue/file@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - repo: ${{ github.repository }} - label: "failure:update-github-config" - comment_if_exists: true - issue_title: "Failure: Update GitHub config workflow" - issue_body: | - Update GitHub config 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}} diff --git a/README.md b/README.md index 6279faad..13f045b5 100644 --- a/README.md +++ b/README.md @@ -130,9 +130,9 @@ BP_COMPOSER_INSTALL_GLOBAL="friendsofphp/php-cs-fixer squizlabs/php_codesniffer= By default `composer install` will be run, even if a cached version of a previous execution was found. This needs to be done, as some composer packages -might install files to a different directory [than the vendor +might install files to a different directory [than the "vendor" one](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md). -As only the dependencies installed to the vendor directory are cached by this +As only the dependencies installed to the _vendor_ directory are cached by this buildpack, these special paths/files would not appear in the image if a cached layer gets used.