-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.43 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build release
on:
release:
types: [published]
jobs:
build_release:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4.5.0
with:
distribution: 'temurin'
java-version: 22
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4.1.0
- name: Install libcurl4
run: sudo apt-get install -y libcurl4-gnutls-dev
- name: Build
env:
ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }}
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUser: ${{ secrets.SONATYPE_USER }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: ./gradlew -Pversion=$VERSION -PjvmOnlyBuild=false build sourcesJar dokkaHtml publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Find branch from tag
id: find-branch
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: |
BRANCH=$(git branch -r --contains $TAG_NAME | grep -v '\->' | sed 's/origin\///' | head -n 1)
if [ -z "$BRANCH" ]; then
echo "Branch not found for tag $TAG"
exit 1
fi
echo Branch: $BRANCH
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Checkout branch HEAD
run: git checkout ${BRANCH}
# - name: Update README
# run: sed -i "s/com\.xemantic\.anthropic:anthropic-sdk-kotlin:[0-9]\+\(\.[0-9]\+\)*\>/com.xemantic.anthropic:anthropic-sdk-kotlin:$VERSION/g" README.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.5
with:
token: ${{ secrets.WORKFLOW_SECRET }}
commit-message: README.md gradle dependencies update to ${{ env.VERSION }}
title: PR Action - README.md gradle dependencies update to ${{ env.VERSION }}