-
Notifications
You must be signed in to change notification settings - Fork 17
74 lines (61 loc) · 2.4 KB
/
publish_inkSDK_mavencentral.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
72
73
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: publish-inkSDK-mavencentral
# This workflow builds and publishes in Maven Central the Ink SDK artifact.
# Although the final publishing step has to be done manually in Sonatype site.
on:
push:
tags:
- 'ink*'
workflow_dispatch:
inputs:
name:
description: 'Triggers publication to MavenCentral - inkSDK'
home:
description: 'location'
required: false
jobs:
publish-inkSDK:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$SIGNING_SECRET_KEY' | base64 -d > '$SIGNING_SECRET_FILE'"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: clean
run: ./gradlew :inksdk:ink:clean
# Builds the release artifacts of the library
- name: Release build
run: ./gradlew :inksdk:ink:assembleRelease
# Generates other artifacts
- name: Source jar
run: ./gradlew :inksdk:ink:androidSourcesJar
# Generates docs artifact
- name: Docs jar
run: ./gradlew :inksdk:ink:dokkaHtmlJar
# Runs upload to MavenCentral (final release step will be manually done in Sonatype site)
- name: Publish to MavenCentral
run: ./gradlew :inksdk:ink:publishSurfaceDuoSDKPublicationToMavencentralRepository --max-workers 1
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}