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
44 changes: 28 additions & 16 deletions .github/workflows/cache-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
types: [closed]
schedule:
- cron: '0 3 * * 0' # Sundays at 03:00 UTC
- cron: '0 3 * * *' # Daily at 03:00 UTC
workflow_dispatch:

permissions:
Expand All @@ -20,20 +20,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Delete caches for closed PR branch
- name: Delete caches for closed PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
PR_NUMBER: ${{ github.event.pull_request.number }}
HEAD_BRANCH: refs/heads/${{ github.event.pull_request.head.ref }}
run: |
echo "Deleting caches for branch: $BRANCH"
gh actions-cache list --branch "$BRANCH" --limit 100 | \
cut -f1 | \
while read -r key; do
if [ -n "$key" ]; then
echo "Deleting cache: $key"
gh actions-cache delete "$key" --branch "$BRANCH" --confirm || true
fi
done
for branch in "refs/pull/$PR_NUMBER/merge" "$HEAD_BRANCH"; do
echo "Deleting caches for branch: $branch"
gh actions-cache list --branch "$branch" --limit 100 | \
cut -f1 | \
while read -r key; do
if [ -n "$key" ]; then
echo "Deleting cache: $key"
gh actions-cache delete "$key" --branch "$branch" --confirm || true
fi
done
done

cleanup-stale-caches:
name: Clean Up Stale Caches
Expand All @@ -50,8 +53,9 @@ jobs:
echo "=== Current cache usage ==="
gh actions-cache list --limit 100 --sort last-used --order asc

# Get all open PR branch refs
# Get all open PR numbers and branch refs
OPEN_BRANCHES=$(gh pr list --state open --json headRefName --jq '.[].headRefName')
OPEN_PR_NUMBERS=$(gh pr list --state open --json number --jq '.[].number')

# Delete caches for branches that no longer have open PRs
gh actions-cache list --limit 100 --sort last-used --order asc | while IFS=$'\t' read -r key size branch; do
Expand All @@ -60,10 +64,18 @@ jobs:
continue
fi

# Extract branch name from ref
branch_name="${branch#refs/heads/}"
# Handle refs/pull/*/merge caches
if [[ "$branch" =~ ^refs/pull/([0-9]+)/merge$ ]]; then
pr_num="${BASH_REMATCH[1]}"
if ! echo "$OPEN_PR_NUMBERS" | grep -qx "$pr_num"; then
echo "Deleting stale PR cache: $key (branch: $branch)"
gh actions-cache delete "$key" --branch "$branch" --confirm || true
fi
continue
fi

# Check if branch has an open PR
# Handle refs/heads/* caches
branch_name="${branch#refs/heads/}"
if ! echo "$OPEN_BRANCHES" | grep -qx "$branch_name"; then
echo "Deleting stale cache: $key (branch: $branch)"
gh actions-cache delete "$key" --branch "$branch" --confirm || true
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,23 @@ jobs:

- name: Set release version
run: |
./mvnw versions:set -DnewVersion="${{ steps.version.outputs.version }}" -B --no-transfer-progress
./mvnw versions:set -DnewVersion="${{ steps.version.outputs.version }}" -DprocessAllModules=true -B --no-transfer-progress
./mvnw versions:set -DnewVersion="${{ steps.version.outputs.version }}" -B --no-transfer-progress -f agenteval-bom/pom.xml

- name: Maven build & verify
run: ./mvnw verify -B --no-transfer-progress

- name: Gradle build & verify
run: ./gradlew build --no-daemon

- name: Deploy BOM to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
./mvnw deploy -Prelease -B --no-transfer-progress -f agenteval-bom/pom.xml

- name: Deploy to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
49 changes: 49 additions & 0 deletions agenteval-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,55 @@
</license>
</licenses>

<scm>
<connection>scm:git:git://github.com/ByteVeda/agenteval.git</connection>
<developerConnection>scm:git:ssh://github.com:ByteVeda/agenteval.git</developerConnection>
<url>https://github.com/ByteVeda/agenteval/tree/main</url>
</scm>

<developers>
<developer>
<id>pratyush618</id>
<name>Pratyush</name>
<url>https://github.com/pratyush618</url>
</developer>
</developers>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencyManagement>
<dependencies>
<!-- Core -->
Expand Down
Loading