From 2402f5f4404f3a364ae23203989e98618711d8a5 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Fri, 27 Oct 2023 13:32:00 +0000 Subject: [PATCH 01/22] Updating github-config --- .github/workflows/create-draft-release.yml | 10 +++++----- .github/workflows/lint.yml | 2 +- .github/workflows/test-pull-request.yml | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 281809f..481e28d 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -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 @@ -49,10 +49,9 @@ 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 }} env: @@ -67,10 +66,11 @@ 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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 130481f..d100818 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index b41bd1e..487e1a2 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -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 @@ -49,13 +49,11 @@ 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 }} env: From 79841a3e4ec0137b69d233c8b3240023517652b0 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 8 Nov 2023 13:32:16 +0000 Subject: [PATCH 02/22] Updating github-config --- .github/workflows/create-draft-release.yml | 3 +-- .github/workflows/test-pull-request.yml | 3 +-- scripts/.util/git.sh | 21 -------------------- scripts/integration.sh | 23 ++++++++++------------ 4 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 scripts/.util/git.sh diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 481e28d..8474cab 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -53,9 +53,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - 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: diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 487e1a2..6574ff7 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -55,9 +55,8 @@ jobs: uses: actions/checkout@v3 - 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: diff --git a/scripts/.util/git.sh b/scripts/.util/git.sh deleted file mode 100644 index 71965bc..0000000 --- a/scripts/.util/git.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -eu -set -o pipefail - -# shellcheck source=SCRIPTDIR/print.sh -source "$(dirname "${BASH_SOURCE[0]}")/print.sh" - -function util::git::token::fetch() { - if [[ -z "${GIT_TOKEN:-""}" ]]; then - util::print::title "Fetching GIT_TOKEN" - - GIT_TOKEN="$( - lpass show Shared-CF\ Buildpacks/concourse-private.yml \ - | grep buildpacks-github-token \ - | cut -d ' ' -f 2 - )" - fi - - printf "%s" "${GIT_TOKEN}" -} diff --git a/scripts/integration.sh b/scripts/integration.sh index 13a5635..8e98b15 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -19,15 +19,12 @@ source "${PROGDIR}/.util/git.sh" source "${PROGDIR}/.util/builders.sh" function main() { - local builderArray + local builderArray token builderArray=() + token="" + while [[ "${#}" != 0 ]]; do case "${1}" in - --use-token|-t) - shift 1 - token::fetch - ;; - --help|-h) shift 1 usage @@ -39,6 +36,11 @@ function main() { shift 2 ;; + --token|-t) + token="${2}" + shift 2 + ;; + "") # skip if the argument is empty shift 1 @@ -53,7 +55,7 @@ function main() { util::print::warn "** WARNING No Integration tests **" fi - tools::install "${GIT_TOKEN:-}" + tools::install "${token}" if [ ${#builderArray[@]} -eq 0 ]; then util::print::title "No builders provided. Finding builders in integration.json..." @@ -93,9 +95,9 @@ Runs the integration test suite. OPTIONS --help -h prints the command usage - --use-token -t use GIT_TOKEN from lastpass --builder -b sets the name of the builder(s) that are pulled / used for testing. Defaults to "builders" array in integration.json, if present. + --token Token used to download assets from GitHub (e.g. jam, pack, etc) (optional) USAGE } @@ -144,11 +146,6 @@ function builder_images::pull() { docker pull "${lifecycle_image}" } -function token::fetch() { - GIT_TOKEN="$(util::git::token::fetch)" - export GIT_TOKEN -} - function tests::run() { util::print::title "Run Buildpack Runtime Integration Tests" util::print::info "Using ${1} as builder..." From 01429f24657ad8621d2c45fb5591e4400bddef93 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Thu, 9 Nov 2023 13:41:55 +0000 Subject: [PATCH 03/22] Updating github-config --- scripts/.util/tools.json | 2 +- scripts/integration.sh | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index bce6071..46bdfc0 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.67.2", "jam": "v2.6.0", - "pack": "v0.31.0" + "pack": "v0.32.0" } diff --git a/scripts/integration.sh b/scripts/integration.sh index 8e98b15..46ffbdb 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -12,9 +12,6 @@ source "${PROGDIR}/.util/tools.sh" # shellcheck source=SCRIPTDIR/.util/print.sh source "${PROGDIR}/.util/print.sh" -# shellcheck source=SCRIPTDIR/.util/git.sh -source "${PROGDIR}/.util/git.sh" - # shellcheck source=SCRIPTDIR/.util/builders.sh source "${PROGDIR}/.util/builders.sh" From 326de539aa8d6231ea74078375237a655c68f684 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Tue, 14 Nov 2023 13:32:09 +0000 Subject: [PATCH 04/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 46bdfc0..7dc13f1 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.67.2", - "jam": "v2.6.0", + "jam": "v2.7.0", "pack": "v0.32.0" } From da6777abeb32ee7b905cedcd0495a37eb7fc748e Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Thu, 16 Nov 2023 13:36:31 +0000 Subject: [PATCH 05/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 7dc13f1..082d016 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.67.2", "jam": "v2.7.0", - "pack": "v0.32.0" + "pack": "v0.32.1" } From 3e22d8b72b328daaaaa43506fb1a1fc879330b02 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Tue, 21 Nov 2023 13:32:02 +0000 Subject: [PATCH 06/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 082d016..c9ad9c5 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { - "createpackage": "v1.67.2", + "createpackage": "v1.68.0", "jam": "v2.7.0", "pack": "v0.32.1" } From c8c912aa1563a37097249fd2d0da00f956a9a199 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Sat, 20 Jan 2024 13:32:18 +0000 Subject: [PATCH 07/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index c9ad9c5..d0bb37a 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { - "createpackage": "v1.68.0", + "createpackage": "v1.68.1", "jam": "v2.7.0", "pack": "v0.32.1" } From 2347b8f22f0f5062173f02ad351f53d01778eada Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 7 Feb 2024 13:31:11 +0000 Subject: [PATCH 08/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index d0bb37a..f6d36ce 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.68.1", "jam": "v2.7.0", - "pack": "v0.32.1" + "pack": "v0.33.0" } From b8cf8b72880140d4c99c09a69dd70af2720ef606 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Thu, 8 Feb 2024 13:31:04 +0000 Subject: [PATCH 09/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index f6d36ce..27bf5a5 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.68.1", "jam": "v2.7.0", - "pack": "v0.33.0" + "pack": "v0.33.1" } From 9755184750b2ee527cfe4b0d76a77adce4d6275a Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 14 Feb 2024 13:31:04 +0000 Subject: [PATCH 10/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 27bf5a5..4dde764 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { - "createpackage": "v1.68.1", + "createpackage": "v1.68.2", "jam": "v2.7.0", "pack": "v0.33.1" } From 881a0d770dd8870f83dab0dd0fe86f027ce24e60 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Fri, 16 Feb 2024 13:32:25 +0000 Subject: [PATCH 11/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 4dde764..5125714 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.68.2", "jam": "v2.7.0", - "pack": "v0.33.1" + "pack": "v0.33.2" } From 9046bd4415789a7aa34f2639d1e81a267907e96b Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Tue, 27 Feb 2024 13:32:51 +0000 Subject: [PATCH 12/22] Updating github-config --- scripts/.util/tools.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/.util/tools.sh b/scripts/.util/tools.sh index 35addb0..801e6ac 100644 --- a/scripts/.util/tools.sh +++ b/scripts/.util/tools.sh @@ -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" @@ -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)" From c582e73822812b504adbd8def2e9874e02731f17 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Tue, 5 Mar 2024 13:31:30 +0000 Subject: [PATCH 13/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 5125714..618569b 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.68.2", - "jam": "v2.7.0", + "jam": "v2.7.1", "pack": "v0.33.2" } From f2a6b90d023ff2007eeb32cba87f1b27ac3d9626 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 20 Mar 2024 13:31:26 +0000 Subject: [PATCH 14/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 618569b..88b5a31 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { - "createpackage": "v1.68.2", + "createpackage": "v1.69.0", "jam": "v2.7.1", "pack": "v0.33.2" } From 7288a66bbcce933edbb5b4b8e84351a210eadd4f Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 27 Mar 2024 13:31:03 +0000 Subject: [PATCH 15/22] Updating github-config --- scripts/build.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index a3e1d3d..bf99005 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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}" @@ -73,16 +81,20 @@ 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 } From d9133969d9e910f3e02833135cacf56b1f707357 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Sat, 6 Apr 2024 13:31:27 +0000 Subject: [PATCH 16/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 88b5a31..78b4607 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { - "createpackage": "v1.69.0", + "createpackage": "v1.69.1", "jam": "v2.7.1", "pack": "v0.33.2" } From ee8f8684b09f366d56a4c23f3a336997fdf50ac0 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Fri, 19 Apr 2024 13:32:15 +0000 Subject: [PATCH 17/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 78b4607..76f8dd4 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.69.1", - "jam": "v2.7.1", + "jam": "v2.7.2", "pack": "v0.33.2" } From 506ed236e6e6d409c983c42667857494492e2e9c Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Sat, 4 May 2024 13:31:15 +0000 Subject: [PATCH 18/22] Updating github-config --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1f5b215..bf99f0e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" From 4c2db081c55ab6a84fa966336cf7df4e07db5453 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Fri, 10 May 2024 13:31:01 +0000 Subject: [PATCH 19/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 76f8dd4..92f3372 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { - "createpackage": "v1.69.1", + "createpackage": "v1.70.0", "jam": "v2.7.2", "pack": "v0.33.2" } From cd11163870a4c3c9459f65454265c17b3ecb82b1 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Fri, 31 May 2024 13:31:06 +0000 Subject: [PATCH 20/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 92f3372..52887a4 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.70.0", "jam": "v2.7.2", - "pack": "v0.33.2" + "pack": "v0.34.0" } From c63b68042d7bca5b2a3579fef59130a681f34bdb Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Sat, 1 Jun 2024 13:30:55 +0000 Subject: [PATCH 21/22] Updating github-config --- scripts/.util/tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.util/tools.json b/scripts/.util/tools.json index 52887a4..4ca13fa 100644 --- a/scripts/.util/tools.json +++ b/scripts/.util/tools.json @@ -1,5 +1,5 @@ { "createpackage": "v1.70.0", "jam": "v2.7.2", - "pack": "v0.34.0" + "pack": "v0.34.1" } From 65a184cd858d73fcc209067701813718d8a1bdf4 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 5 Jun 2024 13:32:49 +0000 Subject: [PATCH 22/22] Updating github-config --- .github/workflows/publish-releases.yml | 41 +++++++++ .github/workflows/update-go-mod-version.yml | 93 +++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 .github/workflows/publish-releases.yml create mode 100644 .github/workflows/update-go-mod-version.yml diff --git a/.github/workflows/publish-releases.yml b/.github/workflows/publish-releases.yml new file mode 100644 index 0000000..495341a --- /dev/null +++ b/.github/workflows/publish-releases.yml @@ -0,0 +1,41 @@ +name: Publish Draft Releases + +on: + workflow_dispatch: {} + schedule: + - cron: '0 5 * * WED' # Weekly on Wednesday at 5:00 AM UTC + +concurrency: + group: publish-release + +jobs: + publish: + name: Publish + runs-on: ubuntu-22.04 + steps: + - name: Publish Draft Release With Highest Semantic Version + id: drafts + env: + GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + uses: paketo-buildpacks/github-config/actions/release/publish-drafts@main + with: + repo: ${{ github.repository }} + + failure: + name: Alert on Failure + runs-on: ubuntu-22.04 + needs: [ publish ] + if: ${{ always() && needs.publish.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: Publish draft releases" + 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}} diff --git a/.github/workflows/update-go-mod-version.yml b/.github/workflows/update-go-mod-version.yml new file mode 100644 index 0000000..2cc949c --- /dev/null +++ b/.github/workflows/update-go-mod-version.yml @@ -0,0 +1,93 @@ +name: Update Go version + +on: + schedule: + - cron: '48 4 * * MON' # every monday at 4:48 UTC + workflow_dispatch: + +concurrency: update-go + +jobs: + update-go: + name: Update go toolchain in go.mod + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Checkout PR Branch + uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main + with: + branch: automation/go-mod-update/update-main + - name: Setup Go + id: setup-go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + - name: Get current go toolchain version + id: current-go-version + uses: paketo-buildpacks/github-config/actions/update-go-mod-version@main + with: + toolchain-version: ${{ steps.setup-go.outputs.go-version }} + - name: Go mod tidy + run: | + #!/usr/bin/env bash + set -euo pipefail + shopt -s inherit_errexit + + echo "Before running go mod tidy" + echo "head -n10 go.mod " + head -n10 go.mod + + echo "git diff" + git diff + + echo "Running go mod tidy" + go mod tidy + + echo "After running go mod tidy" + echo "head -n10 go.mod " + head -n10 go.mod + + echo "git diff" + git diff + - name: Commit + id: commit + uses: paketo-buildpacks/github-config/actions/pull-request/create-commit@main + with: + message: "Updates go mod toolchain version to ${{ steps.setup-go.outputs.go-version }}" + 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/go-mod-update/update-main + + - 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 go mod toolchain version to ${{ steps.setup-go.outputs.go-version }}" + branch: automation/go-mod-update/update-main + + failure: + name: Alert on Failure + runs-on: ubuntu-22.04 + needs: [update-go] + if: ${{ always() && needs.update-go.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-go-version" + comment_if_exists: true + issue_title: "Failure: Update Go Mod Version workflow" + 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}}