-
Notifications
You must be signed in to change notification settings - Fork 14
66 lines (62 loc) · 1.85 KB
/
build.yaml
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
name: Build and Test
on: [push, pull_request]
env:
MAVEN_USER: adtran
MAVEN_SYNC: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # unlimited
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Gradle
run: >
./gradlew build cobertura
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
environment: publish
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # unlimited
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Publish to plugins.gradle.org
id: publish_to_gradle
run: >
./gradlew publishPlugins
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
- name: Publish to OSSRH
id: publish_to_ossrh
run: >
./gradlew publishScalaMultiVersionPublicationToOssrhRepository
-PossrhUsername=${{ secrets.OSSRH_USERNAME }}
-PossrhPassword=${{ secrets.OSSRH_PASSWORD }}
- name: Tag
if: >
${{
steps.publish_to_gradle.conclusion == 'success' ||
steps.publish_to_ossrh.conclusion == 'success'
}}
run: |
version=$(./gradlew --quiet printVersion)
tag=v$version
git config --global user.name 'Github Actions'
git config --global user.email '[email protected]'
git tag -m "automatic tag for $version" "$tag"
git push origin "$tag"