This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (50 loc) · 1.67 KB
/
build.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
name: Build and publish Android library
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- main
jobs:
build:
name: "Build and publish Android library"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Rust toolchain
run: rustup show
- name: Build
run: >
./gradlew assembleRelease &&
jar tvf $( find . -name '*-release.aar' ) |
grep '\.so$'
- name: Retrieve tag name
uses: actions/github-script@v3
id: get-tag
if: startsWith(github.ref, 'refs/tags/')
with:
# The format for ref is `refs/tags/<tag_name>`
script: return context.ref.split('/')[2]
result-encoding: string
- name: Create tag release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Release ${{ steps.get-tag.outputs.result }}
draft: false
files: |
./artiwrapper/build/outputs/aar/artiwrapper-release.aar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEYID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}