generated from DanySK/template-for-gradle-plugins
73 lines (72 loc) · 2.38 KB
/
build-and-deploy.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
name: CI/CD Process
on:
workflow_call:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [windows, macos, ubuntu]
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout
uses: DanySK/action-checkout@0.2.3
- uses: DanySK/build-check-deploy-gradle-action@2.1.17
with:
deploy-command: >-
./gradlew
uploadKotlin
uploadPluginMavenToMavenCentralNexus
uploadPluginMarkerMavenToMavenCentralNexus
close
--parallel
should-run-codecov: ${{ runner.os == 'Linux' }}
should-deploy: >-
${{
runner.os == 'Linux'
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
}}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
release:
needs:
- build
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
concurrency:
group: release
steps:
- name: Checkout
uses: actions/checkout@v3.2.0
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
- uses: DanySK/build-check-deploy-gradle-action@2.1.17
with:
build-command: true
check-command: true
deploy-command: |
npm install
npx semantic-release
should-run-codecov: false
should-deploy: true
should-validate-wrapper: false
github-token: ${{ github.token }}
gradle-publish-secret: ${{ secrets.GRADLE_PUBLISH_SECRET }}
gradle-publish-key: ${{ secrets.GRADLE_PUBLISH_KEY }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
success:
runs-on: ubuntu-latest
needs:
- build
- release
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
|| !contains(join(needs.*.result, ','), 'cancelled')
)
steps:
- name: Verify that the workflow executed and there were no failures
run: ${{ !contains(join(needs.*.result, ','), 'failure') }}