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 #333

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
27 changes: 27 additions & 0 deletions .github/workflows/push-buildpackage.yml
Original file line number Diff line number Diff line change
@@ -4,13 +4,18 @@ on:
release:
types:
- published
env:
REGISTRIES_FILENAME: "registries.json"

jobs:
push:
name: Push
runs-on: ubuntu-22.04
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Parse Event
id: event
run: |
@@ -30,6 +35,26 @@ jobs:
output: "/github/workspace/buildpackage.cnb"
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}

- name: Parse Configs
id: parse_configs
run: |
registries_filename="${{ env.REGISTRIES_FILENAME }}"
push_to_dockerhub=true
push_to_gcr=true
if [[ -f $registries_filename ]]; then
if jq 'has("dockerhub")' $registries_filename > /dev/null; then
push_to_dockerhub=$(jq '.dockerhub' $registries_filename)
fi
if jq 'has("GCR")' $registries_filename > /dev/null; then
push_to_gcr=$(jq '.GCR' $registries_filename)
fi
fi
echo "push_to_dockerhub=${push_to_dockerhub}" >> "$GITHUB_OUTPUT"
echo "push_to_gcr=${push_to_gcr}" >> "$GITHUB_OUTPUT"
- name: Validate version
run: |
buidpackTomlVersion=$(sudo skopeo inspect "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" | jq -r '.Labels."io.buildpacks.buildpackage.metadata" | fromjson | .version')
@@ -40,6 +65,7 @@ jobs:
fi
- name: Push to GCR
if: ${{ steps.parse_configs.outputs.push_to_gcr == 'true' }}
env:
GCR_PUSH_BOT_JSON_KEY: ${{ secrets.GCR_PUSH_BOT_JSON_KEY }}
run: |
@@ -50,6 +76,7 @@ jobs:
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:latest"
- name: Push to DockerHub
if: ${{ steps.parse_configs.outputs.push_to_dockerhub == 'true' }}
id: push
env:
DOCKERHUB_USERNAME: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_USERNAME }}
4 changes: 3 additions & 1 deletion .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ jobs:
uses: actions/checkout@v3

- name: Run Unit Tests
env:
GO_TEST_PARAMS: -count=5
run: ./scripts/unit.sh

- name: Get builders from integration.json
@@ -80,7 +82,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: event-payload
path: ${{ github.event_path }}
6 changes: 3 additions & 3 deletions .github/workflows/update-go-mod-version.yml
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ jobs:
id: current-go-version
uses: paketo-buildpacks/github-config/actions/update-go-mod-version@main
with:
toolchain-version: ${{ steps.setup-go.outputs.go-version }}
go-version: ${{ steps.setup-go.outputs.go-version }}
- name: Go mod tidy
run: |
#!/usr/bin/env bash
@@ -54,7 +54,7 @@ jobs:
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 }}"
message: "Updates go mod version to ${{ steps.setup-go.outputs.go-version }}"
pathspec: "."
keyid: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY_ID }}
key: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY }}
@@ -70,7 +70,7 @@ jobs:
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 }}"
title: "Updates go mod version to ${{ steps.setup-go.outputs.go-version }}"
branch: automation/go-mod-update/update-main

failure:
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.70.0",
"jam": "v2.8.0",
"pack": "v0.34.2"
"createpackage": "v1.72.1",
"jam": "v2.10.1",
"pack": "v0.36.2"
}
8 changes: 2 additions & 6 deletions scripts/.util/tools.sh
Original file line number Diff line number Diff line change
@@ -142,12 +142,10 @@ function util::tools::pack::install() {
pack_config_enable_experimental="false"
fi

tmp_location="/tmp/pack.tgz"
curl_args=(
"--fail"
"--silent"
"--location"
"--output" "${tmp_location}"
)

if [[ "${token}" != "" ]]; then
@@ -160,16 +158,14 @@ function util::tools::pack::install() {
arch=$(util::tools::arch --blank-amd64)

curl "https://github.com/buildpacks/pack/releases/download/${version}/pack-${version}-${os}${arch:+-$arch}.tgz" \
"${curl_args[@]}"

tar xzf "${tmp_location}" -C "${dir}"
"${curl_args[@]}" | \
tar xzf - -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)"
fi
4 changes: 3 additions & 1 deletion scripts/unit.sh
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ set -o pipefail
readonly PROGDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly BUILDPACKDIR="$(cd "${PROGDIR}/.." && pwd)"

GO_TEST_PARAMS="${GO_TEST_PARAMS:-}"

# shellcheck source=SCRIPTDIR/.util/tools.sh
source "${PROGDIR}/.util/tools.sh"

@@ -50,7 +52,7 @@ function unit::run() {

testout=$(mktemp)
pushd "${BUILDPACKDIR}" > /dev/null
if go test ./... -v -run Unit | tee "${testout}"; then
if go test ./... -v ${GO_TEST_PARAMS} -run Unit | tee "${testout}"; then
util::tools::tests::checkfocus "${testout}"
util::print::success "** GO Test Succeeded **"
else

Unchanged files with check annotations Beta

on:
schedule:
- cron: '27 13 * * *' # daily at 13:27 UTC

Check warning on line 5 in .github/workflows/update-github-config.yml

GitHub Actions / lintYaml

5:25 [comments] too few spaces before comment
workflow_dispatch: {}
concurrency: github_config_update
pull_request:
branches: [ main ]
schedule:
- cron: '34 5 * * *' # daily at 5:34am UTC

Check warning on line 9 in .github/workflows/codeql-analysis.yml

GitHub Actions / lintYaml

9:24 [comments] too few spaces before comment
jobs:
analyze: