-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (102 loc) · 4.05 KB
/
build-and-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
name: CI/CD Process
on:
workflow_call:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [windows, macos, ubuntu]
jvm_version: [11, 17]
distribution: [temurin]
concurrency:
group: ${{ github.workflow }}-build-${{ matrix.os }}-${{ matrix.jvm_version }}-${{ github.event.number || github.ref }}
runs-on: ${{ matrix.os }}-latest
env:
JAVA_VERSION: ${{ matrix.jvm_version }}
OS: ${{ matrix.os }}
TERM: dumb
steps:
# Checkout the repository
- name: Checkout
uses: danysk/action-checkout@0.2.5
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
- name: Compute the version of Maven
id: maven
shell: bash
run: |
# Idea: the regex matcher of Renovate keeps this string up to date automatically
# The version is extracted and used to access the correct version of the scripts
USES=$(cat <<TRICK_RENOVATE
- uses: apache/maven@3.8.6
TRICK_RENOVATE
)
echo "Scripts update line: \"$USES\""
echo "Computed version: \"${USES#*@v}\""
echo "{version}={${USES#*@v}}" >> $GITHUB_OUTPUT
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: ${{ steps.maven.outputs.version }}
- name: Find the version of Node from package.json
if: matrix.jvm_version == 11 && contains('Linux', runner.os)
id: node-version
run: echo "version=$(jq -r .engines.node package.json)" >> $GITHUB_OUTPUT
- name: Install Node
if: matrix.jvm_version == 11 && contains('Linux', runner.os)
uses: actions/setup-node@v3.6.0
with:
node-version: ${{ steps.node-version.outputs.version }}
- name: Checkout the update site
if: matrix.jvm_version == 11 && contains('Linux', runner.os)
uses: actions/checkout@v3.3.0
with:
path: update-site
fetch-depth: 0
persist-credentials: true
repository: Protelis/update-site
token: ${{ secrets.DEPLOYMENT_TOKEN }}
- uses: DanySK/build-check-deploy-gradle-action@2.1.26
with:
build-command: |
COMMAND="mvn package -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q"
eval $COMMAND || eval $COMMAND || eval $COMMAND
check-command: |
COMMAND="mvn test -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q"
eval $COMMAND || eval $COMMAND || eval $COMMAND
deploy-command: |
echo '${{ secrets.SIGNING_KEY }}' > key.asc
gpg --import key.asc
rm key.asc
COMMAND="mvn deploy nexus-staging:drop -B -Dmaven.test.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q"
eval $COMMAND || eval $COMMAND || eval $COMMAND
npm install
npx semantic-release
java-distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.jvm_version }}
should-run-codecov: false
should-deploy: >-
${{
matrix.jvm_version == 11
&& matrix.os == 'ubuntu'
&& !github.event.repository.fork
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
}}
should-validate-wrapper: false
github-token: ${{ secrets.DEPLOYMENT_TOKEN }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
success:
runs-on: ubuntu-latest
needs:
- build
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
|| !contains(join(needs.*.result, ','), 'cancelled')
)
steps:
- name: Verify that there were no failures
run: ${{ !contains(join(needs.*.result, ','), 'failure') }}