-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (46 loc) · 1.76 KB
/
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
name: Publish release
run-name: Publish release ${{ github.event.release.tag_name }}
on:
workflow_dispatch:
release:
types: [ prereleased, released ]
jobs:
publish:
name: "Publish release"
timeout-minutes: 60
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Test version
id: version
run: |
version=$(cat lib/build.gradle.kts | grep -E 'version = "' | cut -d \" -f 2)
if git show-ref --tags --quiet --verify -- "refs/tags/$version" >/dev/null; then
echo "Git tag $version already exists, failing to publish";
exit 1
else
echo "release_tag=$version" >> $GITHUB_OUTPUT
fi
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: ${{ vars.JVM_DISTRIBUTION }}
java-version: ${{ vars.JVM_VERSION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Cache konan directory
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/build.gradle.kts') }}
restore-keys: "${{ runner.os }}-konan-"
- name: Build and Maven publish
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache --stacktrace