-
Notifications
You must be signed in to change notification settings - Fork 49
154 lines (149 loc) · 5.9 KB
/
gradle.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI Tests
on: [push]
jobs:
build-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build -Porg.gradle.dependency.verification.console=verbose --dependency-verification strict
- uses: actions/upload-artifact@v4
if: failure()
with:
name: dependency-verification
path: build/reports/dependency-verification/
deb_install_tests:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
jdk: [ "openjdk-11-jdk","openjdk-17-jdk","openjdk-21-jdk" ]
ubuntu: ["20.04", "22.04"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Initialize Gradle
run: ./gradlew version --dependency-verification off
- name: Get RPM Version
id: get_rpm_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet --dependency-verification off | sed 's/-/./') && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: mkdirs
run: mkdir -p rd-cli-tool/build/distributions
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: rundeck.deb
path: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
- name: deb/rpm install test
run: bash scripts/install-test.sh -deb
env:
UBUNTUVERS: ${{matrix.ubuntu}}
DEBJDK: ${{matrix.jdk}}
DEBFILE: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --dependency-verification off
- name: Integration tests
run: ./gradlew integrationTest --dependency-verification off
- uses: actions/upload-artifact@v4
if: failure()
with:
name: integration-test-report
path: integration-tests/build/reports/tests/integrationTest
# - name: deb/rpm install test
# run: bash scripts/install-test.sh
- name: rpm upgrade test
run: bash scripts/rpm-upgrade.sh
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet --dependency-verification off) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get RPM Version
id: get_rpm_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet --dependency-verification off | sed 's/-/./') && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Upload zip
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rd-${{ steps.get_version.outputs.VERSION }}.zip
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rd-${{ steps.get_version.outputs.VERSION }}.zip
- name: Upload rpm
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck-cli-${{ steps.get_rpm_version.outputs.VERSION }}-1.noarch.rpm
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rundeck-cli-${{ steps.get_rpm_version.outputs.VERSION }}-1.noarch.rpm
- name: Upload deb
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
- name: Upload deb-basic
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck.deb
# Directory containing files to upload
path: rd-cli-tool/build/distributions/rundeck-cli_${{ steps.get_rpm_version.outputs.VERSION }}-1_all.deb
- name: Upload all-jar
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rundeck-cli-${{ steps.get_version.outputs.VERSION }}-all.jar
# Directory containing files to upload
path: rd-cli-tool/build/libs/rundeck-cli-${{ steps.get_version.outputs.VERSION }}-all.jar
- name: Upload api-lib
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rd-api-client-${{ steps.get_version.outputs.VERSION }}.jar
# Directory containing files to upload
path: rd-api-client/build/libs/rd-api-client-${{ steps.get_version.outputs.VERSION }}.jar
- name: Upload rd-cli-lib
uses: actions/upload-artifact@v4
with:
# Artifact name
name: rd-cli-lib-${{ steps.get_version.outputs.VERSION }}.jar
# Directory containing files to upload
path: rd-cli-lib/build/libs/rd-cli-lib-${{ steps.get_version.outputs.VERSION }}.jar