-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (82 loc) · 2.78 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Release"
on:
workflow_dispatch:
inputs:
dryRun:
description: "Do a dry run to preview instead of a real release [true/false]"
required: true
default: "false"
jobs:
semantic-release:
name: "Semantic Release"
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
GIT_AUTHOR_NAME: mparticle-automation
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: mparticle-automation
GIT_COMMITTER_EMAIL: [email protected]
steps:
- name: "Checkout public main branch"
uses: actions/checkout@v3
with:
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
fetch-depth: 0
ref: main
- name: "Import GPG Key"
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: "Semantic Release --dry-run"
if: ${{ github.event.inputs.dryRun == 'true' }}
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @semantic-release/exec@5 \
-p conventional-changelog-conventionalcommits \
semantic-release --dry-run
- name: "Semantic Release"
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @semantic-release/exec@5 \
-p conventional-changelog-conventionalcommits \
semantic-release
- name: "Push automated release commits to release branch"
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
git push origin main
sonatype-release:
name: "Sonatype Release"
needs: semantic-release
runs-on: macos-latest
if: ${{ github.event.inputs.dryRun == 'false' }}
env:
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
mavenSigningKeyId: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }}
mavenSigningKeyPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }}
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
ref: main
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Publish Android To Sonatype"
run: |
./gradlew -PisRelease=true publishReleasePublicationToMavenRepository --stacktrace