-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (46 loc) · 2.21 KB
/
snapshot-release.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
name: Publish Snapshot builds
on: [pull_request]
permissions:
pull-requests: write # Write access needed to create a comment.
jobs:
publish:
name: Snapshot build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ./.github/actions/setup-android
# Using branch name for name of snapshot. Makes it easy to remember and can easily trigger new builds of Remote Habits.
- name: Set snapshot version
id: set-snapshot-version
# Get the current branch name and replace all / characters with - as / is invalid in gradle names.
run: echo "::set-output name=VERSION::$(echo '${{ github.event.pull_request.head.ref }}' | sed -r 's/\//-/g')-SNAPSHOT"
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository
env:
OSSRH_USERNAME: ${{ secrets.GRADLE_PUBLISH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.GRADLE_PUBLISH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.GRADLE_SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.GRADLE_SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.GRADLE_SIGNING_PRIVATE_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
MODULE_VERSION: ${{ steps.set-snapshot-version.outputs.VERSION }}
SNAPSHOT: true
- name: Find old comment to update comment for
uses: peter-evans/find-comment@v2
id: find-previous-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Build available to test
- name: Inform pull request on build of SDK available to test
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.find-previous-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Build available to test
Version: `${{ steps.set-snapshot-version.outputs.VERSION }}`
Repository: `https://s01.oss.sonatype.org/content/repositories/snapshots/`
edit-mode: replace
token: ${{ secrets.GITHUB_TOKEN }}