forked from dropbox/djinni
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (65 loc) · 3.58 KB
/
publish.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
name: Publish to Ubique Maven and Sonatype Nexus
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: "Publish Djinni SupportLib AAR to Ubique Maven and Sonatype Nexus"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Set Build Variables
id: vars
run: |
artifactId=$(sed -n -e 's/^POM_ARTIFACT_ID=//p' android/gradle.properties)
echo ::set-output name=artifactId::$artifactId
version=$(sed -n -e 's/^VERSION_NAME=//p' android/gradle.properties)
echo ::set-output name=version::$version
- name: Setup GPG Key
env:
SIGNING_KEY_ARMOR: ${{secrets.UBIQUE_MAVEN_SIGNING_KEY_ARMOR_BASE64}}
run: |
echo "Create .gpg key from secret"
echo $SIGNING_KEY_ARMOR | base64 --decode > ./signingkey.asc
gpg --quiet --output $GITHUB_WORKSPACE/signingkey.gpg --dearmor ./signingkey.asc
- name: Build and Upload to Ubique Maven
env:
SIGNING_KEY_ID: ${{secrets.UBIQUE_MAVEN_SIGNING_KEY_ID}}
SIGNING_KEY_PASSWORD: ${{secrets.UBIQUE_MAVEN_SIGNING_KEY_PASSPHRASE}}
UBIQUE_ARTIFACTORY_URL: ${{secrets.UBIQUE_ARTIFACTORY_URL}}
UBIQUE_ARTIFACTORY_USER: ${{secrets.UBIQUE_ARTIFACTORY_USER}}
UBIQUE_ARTIFACTORY_PASS: ${{secrets.UBIQUE_ARTIFACTORY_PASS}}
run: |
cd android
chmod 0777 gradlew
echo "### Maven Dependency - Ubique Maven" >> $GITHUB_STEP_SUMMARY
./gradlew publishAllPublicationsToUbiqueMavenRepository -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/signingkey.gpg -Psigning.password=$SIGNING_KEY_PASSWORD -Psigning.keyId=$SIGNING_KEY_ID
echo "| Git Commit | Artifact ID | Maven Version |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| $GITHUB_SHA | ${{ steps.vars.outputs.artifactId }} | ${{ steps.vars.outputs.version }} |" >> $GITHUB_STEP_SUMMARY
- name: Build and Upload to Maven Central
env:
SIGNING_KEY_ID: ${{secrets.UBIQUE_MAVEN_SIGNING_KEY_ID}}
SIGNING_KEY_PASSWORD: ${{secrets.UBIQUE_MAVEN_SIGNING_KEY_PASSPHRASE}}
SONATYPE_NEXUS_USERNAME: ${{secrets.UBIQUE_MAVEN_CENTRAL_USERNAME}}
SONATYPE_NEXUS_PASSWORD: ${{secrets.UBIQUE_MAVEN_CENTRAL_PASS}}
UBIQUE_ARTIFACTORY_URL: ${{secrets.UBIQUE_ARTIFACTORY_URL}}
UBIQUE_ARTIFACTORY_USER: ${{secrets.UBIQUE_ARTIFACTORY_USER}}
UBIQUE_ARTIFACTORY_PASS: ${{secrets.UBIQUE_ARTIFACTORY_PASS}}
run: |
cd android
chmod 0777 gradlew
echo "### Maven Dependency - Maven Central" >> $GITHUB_STEP_SUMMARY
./gradlew publishAllPublicationsToMavenCentral -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/signingkey.gpg -Psigning.password=$SIGNING_KEY_PASSWORD -Psigning.keyId=$SIGNING_KEY_ID -PmavenCentralUsername=$SONATYPE_NEXUS_USERNAME -PmavenCentralPassword=$SONATYPE_NEXUS_PASSWORD
echo "[Maven Central](https://search.maven.org/artifact/ch.admin.geo.openswissmaps/${{ steps.vars.outputs.artifactId }}/${{ steps.vars.outputs.version }}/aar)" >> $GITHUB_STEP_SUMMARY
echo "| Git Commit | Artifact ID | Maven Version |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| $GITHUB_SHA | ${{ steps.vars.outputs.artifactId }} | ${{ steps.vars.outputs.version }} |" >> $GITHUB_STEP_SUMMARY