-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 2.13 KB
/
distribute.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
name: Publish
on:
release:
# We'll run this workflow when a new GitHub release is created
types: [released]
jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
GPG_SECRET_KEY_RING_FILE: ${{ secrets.GPG_SECRET_KEY_RING_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > 'GPG_SECRET_KEY_RING_FILE'"
- name: Attatch the maven creitenal
env:
MAVEN_USER_NAME: ${{ secrets.FACEBOOK_KEYS }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
run: |
echo -e "mavenCentralUsername=\"MAVEN_USER_NAME\"" >> gradle.properties
echo -e "\mavenCentralPassword=\"MAVEN_PASSWORD\"" >> gradle.properties
- name: Creating local properties file
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_SECRET_KEY_RING_FILE: ${{ secrets.GPG_SECRET_KEY_RING_FILE }}
run: |
echo -e "\signing.keyId=\"GPG_KEY_ID\"" >> local.properties
echo -e "\signing.password=\"GPG_PASSWORD\"" >> local.properties
echo -e "\signing.secretKeyRingFile=\"GPG_SECRET_KEY_RING_FILE\"" >> local.properties
# Runs upload, and then closes & releases the repository
- name: Publish KotlinShaver to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
- name: Publish Kotlinkinfer to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository