-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (43 loc) · 1.6 KB
/
publish-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
name: Publish Release
on:
push:
tags:
- '*.*.*'
jobs:
publish-release:
runs-on: macos-latest
if: github.repository == 'amzn/kotlin-inject-anvil'
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v4
- name: Publish release
run: ./gradlew clean publishAndReleaseToMavenCentral --no-build-cache --stacktrace --show-version
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Extract release notes
id: release_notes
uses: ffurrer2/extract-release-notes@v2
- name: Check if pre-release
id: prerelease
run: |
version=$(grep VERSION_NAME gradle.properties | cut -d'=' -f2)
if [[ $version == *"-beta"* ]]; then
echo "isPrerelease=true" >> $GITHUB_OUTPUT
else
echo "isPrerelease=false" >> $GITHUB_OUTPUT
fi
- name: Create release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.release_notes.outputs.release_notes }}
prerelease: ${{ steps.prerelease.outputs.isPrerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}