This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (68 loc) · 2.1 KB
/
publish.yaml
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
72
73
74
75
76
77
78
79
80
name: Publish
on:
pull_request:
branches:
- main
types:
- closed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
publish:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Assemble AAR
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
- name: "Publish AAR"
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
- name: Get Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
- name: Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.semver.outputs.nextStrict }}
- name: "Get Staging Profile Id"
uses: gradle/gradle-build-action@v2
with:
arguments: getStagingProfile
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
- name: "Close and release to Maven Central"
uses: gradle/gradle-build-action@v2
with:
arguments: closeAndReleaseRepository
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}