This repository was archived by the owner on Sep 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 2.24 KB
/
publish.yml
File metadata and controls
59 lines (57 loc) · 2.24 KB
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
name: Publish
on:
push:
tags:
- 'v*'
jobs:
build:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 20
- name: Fetch Git tags
run: |
git fetch --prune --unshallow --tags
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
GPG_KEY: ${{ secrets.ANDROID_GPG_KEY }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.ANDROID_SECRET_RING_FILE }}
run: |
sudo bash -c "echo '$GPG_KEY' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Assemble
run: ./gradlew assemble
- name: Publish to Maven Central
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseRepository
env:
OSSRH_USERNAME: ${{ secrets.ANDROID_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.ANDROID_OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.ANDROID_SECRET_RING_FILE }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.ANDROID_SONATYPE_STAGING_ID }}
- name: Prepare Slack notification message
id: prepare_slack_message
run: |
wget https://raw.githubusercontent.com/AckeeCZ/android-github-actions-scripts/master/slack/prepare_slack_msg.sh
chmod u+x prepare_slack_msg.sh
./prepare_slack_msg.sh
- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2
if: ${{ job.status == 'success' }}
env:
SLACK_WEBHOOK: ${{ secrets.ANDROID_OSS_NOTIFICATION_WEBHOOK }}
SLACK_USERNAME: 'github-snitch'
SLACK_ICON_EMOJI: ':octocat:'
SLACK_TITLE: ${{ steps.prepare_slack_message.outputs.SLACK_MSG_TITLE }}
SLACK_MESSAGE: ${{ steps.prepare_slack_message.outputs.SLACK_MSG }}
MSG_MINIMAL: true