-
Notifications
You must be signed in to change notification settings - Fork 43
195 lines (184 loc) · 6.69 KB
/
linux-build-test-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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Linux build-test-deploy
on:
push:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
message:
description: 'Summarize the contents since the last version'
required: true
default: 'Auto-generated release'
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Build
uses: ./.github/actions/build-action
- name: Upload JARs
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: ThetaJars
path: subprojects/**/*-all.jar
- name: Positive outcome badge
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} build"
status: "Success"
color: "green"
path: "badges/build-${{ runner.os }}"
- name: Negative outcome badge
if: ${{ failure() }}
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} build"
status: "Failure"
color: "red"
path: "badges/build-${{ runner.os }}"
javadoc:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Deploy javadoc to github-pages
uses: ./.github/actions/deploy-javadoc
test-linux:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04]
needs: build
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install LLVM and Clang
uses: ./.github/actions/install-llvm
with:
version: "15"
- name: Run tests
uses: ./.github/actions/test-action
- name: Positive outcome badge
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} test"
status: "Success"
color: "green"
path: "badges/test-${{ runner.os }}"
- name: Negative outcome badge
if: ${{ failure() && matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/badge-creation
with:
label: "${{ runner.os }} test"
status: "Failure"
color: "red"
path: "badges/test-${{ runner.os }}"
deploy-release:
needs: test-linux
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Create release and deploy JARs
uses: ./.github/actions/create-release
with:
message: ${{ inputs.message }}
deploy-maven:
needs: test-linux
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Create and publish maven release
uses: ./.github/actions/deploy-maven
with:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_PWD: ${{ secrets.PGP_PWD }}
test-docker:
strategy:
matrix:
dockerprojects: ["theta-cfa-cli", "theta-sts-cli", "theta-xsts-cli", "theta-xta-cli"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Version
id: version
run: |
echo version=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}') >> $GITHUB_OUTPUT
- name: docker-login
uses: ./.github/actions/docker-login
with:
username: ${{secrets.DOCKER_USERNAME}}
token: ${{secrets.DOCKER_TOKEN}}
- name: docker-login-ghcr
uses: ./.github/actions/docker-login
with:
registry: ghcr.io
username: ${{github.repository_owner}}
token: ${{secrets.GITHUB_TOKEN}}
- name: Build and publish docker file
uses: ./.github/actions/docker-deploy
with:
project: ${{ matrix.dockerprojects }}
version: ${{ steps.version.outputs.version }}
user-dockerhub: ftsrg
user-ghcr: ftsrg
push: false
deploy-docker:
needs: [test-linux, test-docker]
if: "${{ github.event.inputs.message != '' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}"
strategy:
matrix:
dockerprojects: ["theta-cfa-cli", "theta-sts-cli", "theta-xsts-cli", "theta-xta-cli"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Version
id: version
run: |
echo version=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}') >> $GITHUB_OUTPUT
- name: docker-login
uses: ./.github/actions/docker-login
with:
username: ${{secrets.DOCKER_USERNAME}}
token: ${{secrets.DOCKER_TOKEN}}
- name: docker-login-ghcr
uses: ./.github/actions/docker-login
with:
registry: ghcr.io
username: ${{github.repository_owner}}
token: ${{secrets.GITHUB_TOKEN}}
- name: Build and publish docker file
uses: ./.github/actions/docker-deploy
with:
project: ${{ matrix.dockerprojects }}
version: ${{ steps.version.outputs.version }}
user-dockerhub: ftsrg
user-ghcr: ftsrg
push: true
- name: Docker Hub Description update
uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: ftsrg/${{ matrix.dockerprojects }}
deploy-docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Deploy docs
uses: ./.github/actions/deploy-docs