-
-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (63 loc) · 1.58 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
name: Build
on:
workflow_dispatch:
inputs: {}
push:
branches: [ "develop" ]
tags: [ "v**" ]
pull_request:
branches: [ "develop" ]
permissions:
contents: read
jobs:
checksecret:
runs-on: ubuntu-latest
outputs:
HAVE_SECRETS: ${{ steps.checksecret_job.outputs.HAVE_SECRETS }}
steps:
- id: checksecret_job
env:
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
run: |
echo "HAVE_SECRETS=${{ env.OPENSSL_IV != '' && env.OPENSSL_KEY != '' }}" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [ 'checksecret' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: 17
- name: Build and Test
run: |
bash .build.sh build
test-scripted:
runs-on: ubuntu-latest
needs: [ 'checksecret' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: 17
- name: Build and Test
run: |
bash .build.sh scripted
publish:
runs-on: ubuntu-latest
needs: [ 'build', 'test-scripted', 'checksecret']
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
steps:
- uses: 7mind/github-env@main
with:
java-version: 17
- name: Publish
env:
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
run: |
bash .build.sh secrets publish
all-good:
if: always()
runs-on: ubuntu-latest
needs: [ 'build', 'test-scripted', 'publish' ]
steps:
- run: 'echo "No build required"'