-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 3.21 KB
/
Copy pathmain.yml
File metadata and controls
88 lines (75 loc) · 3.21 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
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
85
86
87
88
name: ParserMob CI
on:
pull_request:
push:
branches:
- develop
jobs:
ci:
runs-on: macos-26
permissions:
contents: write # create the release tag
steps:
- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@8610938e630b3ed86127765237fe3647b9fabd4f
- name: Gradle Build
run: ./gradlew build koverXmlReport --parallel
- name: Upload to Codecov
continue-on-error: true
uses: codecov/codecov-action@v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/reports/kover/report.xml
- name: Upload to Codacy
continue-on-error: true
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/reports/kover/report.xml
# develop is the release branch: every merge publishes an immutable, signed X.Y.Z to Maven
# Central, once the build above passes. Every other branch builds X.Y-SNAPSHOT and never publishes.
- name: Publish
if: github.event_name == 'push'
# Normalize the armored GPG key: literal "\n" -> real newlines (vanniktech's
# signingInMemoryKey needs real newlines); a correct key passes through unchanged.
run: |
export ORG_GRADLE_PROJECT_signingInMemoryKey="$(printf '%b' "$GPG_KEY_RAW")"
./gradlew publishToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
GPG_KEY_RAW: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
# Read back from Gradle so the tag always matches the version just published to Maven Central.
- name: Resolve version
id: version
if: github.event_name == 'push'
run: echo "version=$(./gradlew -q printVersion | grep '^VERSION_NAME=' | cut -d= -f2)" >> $GITHUB_OUTPUT
# Tags the released commit and cuts the matching GitHub release. Done inline rather than from a
# tag-triggered workflow, because tags pushed with GITHUB_TOKEN never trigger other workflows —
# which is also why automatic_release_tag is set: with no tag ref the action has nothing to cut.
- name: PublishRelease
if: github.event_name == 'push'
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
automatic_release_tag: v${{ steps.version.outputs.version }}
- name: Notify slack success
if: success() && github.event_name == 'push'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v2
with:
channel: submob
status: SUCCESS
color: good
- name: Notify slack fail
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v2
with:
channel: submob
status: FAILED
color: danger