-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (88 loc) · 2.64 KB
/
build.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
name: Build
on:
push:
branches:
- "*"
pull_request:
branches:
- main
env:
TAG: felipebz/zpa-cli:nightly
jobs:
build:
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
17
21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew build --refresh-dependencies
- name: Assemble
run: ./gradlew copyJdksToCache jreleaserAssemble
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TAG }}
- if: github.ref == 'refs/heads/main'
name: Push docker image to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ env.TAG }}
- if: github.ref == 'refs/heads/main'
name: Release artifacts
run: ./gradlew jreleaserFullRelease
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
demo:
name: Analyze demo project on SonarCloud
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
repository: utPLSQL/utPLSQL
- name: Analyze with zpa-cli
run: |
docker run --rm \
-v $PWD:/src \
felipebz/zpa-cli:nightly \
--sources . \
--output-file zpa-issues.json \
--output-format sq-generic-issue-import
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.projectKey=utPLSQL-zpa-demo
-Dsonar.organization=felipebz-github
-Dsonar.externalIssuesReportPaths=zpa-issues.json
-Dsonar.pullrequest.provider=
-Dsonar.coverageReportPaths=
-Dsonar.testExecutionReportPaths=
-Dsonar.plsql.file.suffixes=sql,pkg,pks,pkb,fun,pcd,tgg,prc,tpb,trg,typ,tab,tps
-Dsonar.scm.disabled=true
-Dsonar.tests=
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}