-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (49 loc) · 1.69 KB
/
publish-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
name: Publish Library
permissions:
contents: write
on:
workflow_dispatch:
inputs:
versionName:
description: 'Version Name'
required: true
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
name: Publish
runs-on: macOS-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
- name: Grant Permission to Execute Gradle
run: chmod +x gradlew
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew :KDeviceInfo:build --stacktrace
- name: Publish Library
run: |
echo "Publishing library ... 🚀"
./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
echo "Published ✅"
env:
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.versionName }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
- name: Create and push tag
run: |
git config --global user.email "[email protected]"
git config --global user.name "Swapnil Musale"
git tag -a $TAG -m "Release v$TAG"
git push origin $TAG
env:
TAG: ${{ github.event.inputs.versionName }}