From 43a2821da1783c4431a0494e853435a75451d687 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 29 Aug 2024 18:10:11 +0400 Subject: [PATCH] feat: bump deps Bump PKGS, rekres. Signed-off-by: Andrey Smirnov --- .github/workflows/ci.yaml | 6 +-- .github/workflows/weekly.yaml | 4 +- Pkgfile | 2 +- hack/release.sh | 89 +++++++++++++++++++++++++++++++++-- 4 files changed, 92 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 833331d..9fa4d40 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-08-07T15:33:12Z by kres dbf015a. +# Generated on 2024-08-29T14:09:12Z by kres b5ca957. name: default concurrency: @@ -33,7 +33,7 @@ jobs: labels: ${{ steps.retrieve-pr-labels.outputs.result }} services: buildkitd: - image: moby/buildkit:v0.15.1 + image: moby/buildkit:v0.15.2 options: --privileged ports: - 1234:1234 @@ -129,7 +129,7 @@ jobs: - default services: buildkitd: - image: moby/buildkit:v0.15.1 + image: moby/buildkit:v0.15.2 options: --privileged ports: - 1234:1234 diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index 5ee39e8..6980859 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-08-07T15:33:12Z by kres dbf015a. +# Generated on 2024-08-29T14:09:12Z by kres b5ca957. name: weekly concurrency: @@ -16,7 +16,7 @@ jobs: - pkgs services: buildkitd: - image: moby/buildkit:v0.15.1 + image: moby/buildkit:v0.15.2 options: --privileged ports: - 1234:1234 diff --git a/Pkgfile b/Pkgfile index 65c8b20..e5367ef 100644 --- a/Pkgfile +++ b/Pkgfile @@ -4,7 +4,7 @@ format: v1alpha2 vars: PKGS_PREFIX: ghcr.io/siderolabs - PKGS_VERSION: v1.8.0-alpha.0-46-g124d35b + PKGS_VERSION: v1.8.0-alpha.0-52-g4fd2541 # renovate: datasource=git-refs versioning=git depName=https://github.com/awslabs/tc-redirect-tap.git tc_redirect_tap_ref: 2db41f504194e5fa2b1451647c2154c0a840b02c diff --git a/hack/release.sh b/hack/release.sh index 6303403..234e772 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2023-11-02T20:27:13Z by kres 70e6597-dirty. +# Generated on 2024-08-29T14:09:12Z by kres b5ca957. set -e @@ -44,9 +44,92 @@ function commit { exit 1 fi + if is_on_main_branch; then + update_license_files + fi + git commit -s -m "release($1): prepare release" -m "This is the official $1 release." } +function is_on_main_branch { + main_remotes=("upstream" "origin") + branch_names=("main" "master") + current_branch=$(git rev-parse --abbrev-ref HEAD) + + echo "Check current branch: $current_branch" + + for remote in "${main_remotes[@]}"; do + echo "Fetch remote $remote..." + + if ! git fetch --quiet "$remote" &>/dev/null; then + echo "Failed to fetch $remote, skip..." + + continue + fi + + for branch_name in "${branch_names[@]}"; do + if ! git rev-parse --verify "$branch_name" &>/dev/null; then + echo "Branch $branch_name does not exist, skip..." + + continue + fi + + echo "Branch $remote/$branch_name exists, comparing..." + + merge_base=$(git merge-base "$current_branch" "$remote/$branch_name") + latest_main=$(git rev-parse "$remote/$branch_name") + + if [ "$merge_base" = "$latest_main" ]; then + echo "Current branch is up-to-date with $remote/$branch_name" + + return 0 + else + echo "Current branch is not on $remote/$branch_name" + + return 1 + fi + done + done + + echo "No main or master branch found on any remote" + + return 1 +} + +function update_license_files { + script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + parent_dir="$(dirname "$script_dir")" + current_year=$(date +"%Y") + change_date=$(date -v+4y +"%Y-%m-%d" 2>/dev/null || date -d "+4 years" +"%Y-%m-%d" 2>/dev/null || date --date="+4 years" +"%Y-%m-%d") + + # Find LICENSE and .kres.yaml files recursively in the parent directory (project root) + find "$parent_dir" \( -name "LICENSE" -o -name ".kres.yaml" \) -type f | while read -r file; do + temp_file="${file}.tmp" + + if [[ $file == *"LICENSE" ]]; then + if grep -q "^Business Source License" "$file"; then + sed -e "s/The Licensed Work is (c) [0-9]\{4\}/The Licensed Work is (c) $current_year/" \ + -e "s/Change Date: [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/Change Date: $change_date/" \ + "$file" >"$temp_file" + else + continue # Not a Business Source License file + fi + elif [[ $file == *".kres.yaml" ]]; then + sed -E 's/^([[:space:]]*)ChangeDate:.*$/\1ChangeDate: "'"$change_date"'"/' "$file" >"$temp_file" + fi + + # Check if the file has changed + if ! cmp -s "$file" "$temp_file"; then + mv "$temp_file" "$file" + echo "Updated: $file" + git add "$file" + else + echo "No changes: $file" + rm "$temp_file" + fi + done +} + if declare -f "$1" > /dev/null then cmd="$1" @@ -55,7 +138,7 @@ then else cat <