Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ concurrency:
jobs:
check_bump_type:
name: Validate
runs-on: macos-15
runs-on: macos-26
permissions:
contents: write
pull-requests: write
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_USER: ${{ secrets.GH_USER }}
Expand All @@ -32,27 +35,25 @@ jobs:
fi
- name: Check bump type
run: |
git fetch --tags
LATEST_TAG=$(git describe --abbrev=0 --tags)
echo $LATEST_TAG
if [ -z "$LATEST_TAG" ]; then
echo "Latest tag not found" >&2; exit 1;
fi
LATEST_VERSION=$(echo "$LATEST_TAG" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ -n "$LATEST_VERSION" ]; then
LATEST_VERSION="${LATEST_VERSION}"
else
echo "Failed to extract version from tag: $LATEST_TAG" >&2; exit 1;
fi
git fetch
NEW_BUMP_TYPE=""
if [[ $INPUT_TITLE =~ \[(.*)\] ]]; then
NEW_BUMP_TYPE="${BASH_REMATCH[1]}"
else
echo "Bump type not found" >&2; exit 1;
fi
if [[ "$NEW_BUMP_TYPE" == "$none" ]]; then
echo "Bump type none, skip compare"
exit 0
fi
base_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
target_branch=${{ github.event.pull_request.base.ref }}
chmod +x ./scripts/helpers/build_and_dump.sh
chmod +x ./scripts/helpers/abi_comparator.sh
tmp_dir=$(mktemp -d)
current_abi_dump_path=$(./scripts/helpers/build_and_dump.sh $tmp_dir)
./scripts/helpers/abi_comparator.sh $tmp_dir $LATEST_VERSION $current_abi_dump_path $NEW_BUMP_TYPE
base_tmp_dir=$(mktemp -d)
base_abi_dump_path=$(./scripts/helpers/build_and_dump.sh $base_tmp_dir)
git checkout -b target_branch
target_tmp_dir=$(mktemp -d)
target_abi_dump_path=$(./scripts/helpers/build_and_dump.sh $target_tmp_dir)
./scripts/helpers/abi_comparator.sh $base_tmp_dir $target_abi_dump_path $base_abi_dump_path $NEW_BUMP_TYPE

14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
draft_release:
name: Draft Release
runs-on: macos-15
runs-on: macos-26
permissions:
contents: write
pull-requests: write
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
run: |
LATEST_VERSION="${{ env.LATEST_VERSION }}"

ALL_MESSAGES=$(git log "$LATEST_VERSION"..HEAD --format=%B | grep -E "\[(patch|minor|major)\] (feat|fix|refactor): .*")
ALL_MESSAGES=$(git log "$LATEST_VERSION"..HEAD --format=%B | grep -E "\[(patch|minor|major)\] .*" | sed "s/\[/• \[/g")
echo $ALL_MESSAGES
chmod +x ./scripts/helpers/incr_semver.sh

Expand Down Expand Up @@ -122,7 +122,15 @@ jobs:
chmod +x ./scripts/helpers/abi_comparator.sh
tmp_dir=$(mktemp -d)
current_abi_dump_path=$(./scripts/helpers/build_and_dump.sh $tmp_dir)
./scripts/helpers/abi_comparator.sh $tmp_dir $LATEST_VERSION $current_abi_dump_path $NEW_BUMP_TYPE
old_abi_dump_path="$tmp_dir/old-abi.json"
url="https://github.com/geko-tech/ProjectDescription/releases/download/${LATEST_VERSION}/current-abi.json"
code=$(curl -L -s -w "%{http_code}" "$url" -o "$old_abi_dump_path")
if [ "$code" != "200" ]; then
echo "Failed to download API dumps. URL: $url (Status: $code)"
exit 1
fi

./scripts/helpers/abi_comparator.sh $tmp_dir $old_abi_dump_path $current_abi_dump_path $NEW_BUMP_TYPE

# zip current-abi.zip current_abi_dump_path
echo "ABI_PATH=$current_abi_dump_path" >> $GITHUB_ENV
Expand Down
21 changes: 8 additions & 13 deletions scripts/helpers/abi_comparator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ log_info() { echo "ℹ️ $1"; }

# Input

ABI_URL="https://github.com/geko-tech/ProjectDescription/releases/download"
PROJECT_DESCRIPTION_ABI_URL="${ABI_URL}"

TMP_DIR=$1
LATEST_VERSION=$2
PREV_DUMP_PATH=$2
CURRENT_ABI_DUMP_PATH=$3
BUMP_TYPE=$4

Expand Down Expand Up @@ -73,20 +70,18 @@ bump_type_from_report() {
fi
}

# Loading an old dump
old_abi_dump_path="$TMP_DIR/old-abi.json"
url="${PROJECT_DESCRIPTION_ABI_URL}/${LATEST_VERSION}/current-abi.json"

log_info "Downloading old ABI dump..."
code=$(curl -L -s -w "%{http_code}" "$url" -o "$old_abi_dump_path")
if [ "$code" != "200" ]; then
log_error "Failed to download API dumps. URL: $url (Status: $code)"
if [[ -f "$FILE_VAR" ]]; then
echo "$FILE_VAR exists and is a regular file."
else
echo "$FILE_VAR is not a regular file or does not exist."
fi

# Loading an old dump

# Prepare old dump (remove all "deprecated")
log_info "Prepare old dump"
old_prepared_path="$TMP_DIR/old-prepared.json"
prepare_dump "$old_abi_dump_path" "$old_prepared_path"
prepare_dump "$PREV_DUMP_PATH" "$old_prepared_path"
log_success "Dump prepared"

# ABI compare
Expand Down
Loading