-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (118 loc) · 4.15 KB
/
ci.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: ci-pipeline
on:
create:
branches: [ release/** ]
push:
branches:
- main
- hotfix/**
tags: [ 'v*' ]
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.github/*.yml'
- '*.md'
- 'LICENSE'
pull_request:
types: [ opened, synchronize, reopened, closed ]
branches:
- main
- hotfix/**
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.github/*.yml'
- '*.md'
- 'LICENSE'
jobs:
context:
uses: zero88/shared-ghactions/.github/workflows/project-context.yml@main
with:
profile: 'schedulerx'
secrets:
githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
build:
uses: zero88/shared-ghactions/.github/workflows/gradle-build.yml@main
needs: context
if: needs.context.outputs.shouldBuild == 'true'
strategy:
matrix:
java: [ '11', '17', '21' ]
os: [ 'ubuntu-latest', 'windows-latest' ]
fail-fast: false
name: With Java-${{ matrix.java }} on ${{ matrix.os }}
with:
profile: 'ciBuild'
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
docs:
uses: zero88/shared-ghactions/.github/workflows/antora-docs.yml@main
needs: [ context, build ]
if: needs.context.outputs.shouldBuild == 'true'
with:
profile: 'schedulerx'
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
sha: ${{ needs.context.outputs.sha }}
isRelease: ${{ needs.context.outputs.isRelease }}
antoraBuildDir: docs/build/docs/antora
syncDoc: ${{ needs.context.outputs.shouldPublish }}
docBranch: ${{ needs.context.outputs.docBranch }}
docVersion: ${{ needs.context.outputs.docVersion }}
docCommitMsg: ${{ needs.context.outputs.docCommitMsg }}
secrets:
githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
webdocs:
uses: zero88/shared-ghactions/.github/workflows/webdocs-communal-publish.yml@main
needs: [ context, docs ]
if: needs.context.outputs.shouldPublish == 'true'
with:
webdocsRepo: 'zero88/webdocs'
webdocsRef: 'main'
webdocsWorkflow: 'webdocs.yml'
docCommitMsg: ${{ needs.context.outputs.docCommitMsg }}
secrets:
githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}
test:
uses: zero88/shared-ghactions/.github/workflows/gradle-analysis.yml@main
needs: [ context, build ]
if: needs.context.outputs.shouldBuild == 'true'
with:
profile: 'ciSonar'
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
branch: ${{ needs.context.outputs.branch }}
secrets:
githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}
sonarToken: ${{ secrets.OSS_SONARQUBE_TOKEN }}
publish:
uses: zero88/shared-ghactions/.github/workflows/gradle-publish.yml@main
needs: [ context, test, docs ]
if: needs.context.outputs.shouldPublish == 'true'
with:
profile: 'schedulerx'
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
isRelease: ${{ needs.context.outputs.isRelease }}
secrets:
ossrhUser: ${{ secrets.OSS_SONATYPE_USER }}
ossrhToken: ${{ secrets.OSS_SONATYPE_PASSWORD }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
release:
runs-on: ubuntu-latest
needs: [ context, webdocs, publish ]
if: needs.context.outputs.isRelease == 'true'
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release 'schedulerx' ${{ needs.context.outputs.version }}
tag_name: ${{ needs.context.outputs.branch }}
generate_release_notes: true