-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (91 loc) · 2.71 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
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
create:
tags:
- "*"
repository_dispatch:
types:
- build
jobs:
build:
name: Build
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
include:
- os: ubuntu-latest
may-publish: true
runs-on: ${{ matrix.os }}
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- name: Check new version
if: matrix.may-publish && github.event_name == 'create' && github.event.ref_type == 'tag'
id: check-tag
run: |
tagName="${GITHUB_REF#refs/tags/}"
if printf '%s' "$tagName" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "tag=$tagName" >>"$GITHUB_OUTPUT"
fi
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: temurin
cache: maven
-
name: Install Xerces with XSD 1.1 support in local M2 repository (POSIX)
if: startsWith(matrix.os, 'windows') == false
run: ./bin/install-xerces-m2.sh
-
name: Install Xerces with XSD 1.1 support in local M2 repository (Windows)
if: startsWith(matrix.os, 'windows')
run: ./bin/install-xerces-m2.ps1
-
name: Update version
if: steps.check-tag.outputs.tag
run: mvn --batch-mode "-Dstyle.color=always" "org.eclipse.tycho:tycho-versions-plugin:2.7.5:set-version" "-DnewVersion=${{ steps.check-tag.outputs.tag }}"
-
name: Compile
run: mvn --batch-mode "-Dstyle.color=always" compile
-
name: Verify
run: mvn --batch-mode "-Dstyle.color=always" verify
-
name: Print version
run: java -jar concrete-cif.jar --version
-
name: Test jar (POSIX)
if: startsWith(matrix.os, 'windows') == false
run: ./.github/workflows/test-jar.sh
-
name: Test jar (Windows)
if: startsWith(matrix.os, 'windows')
run: ./.github/workflows/test-jar.ps1
-
name: Calculate hash
if: steps.check-tag.outputs.tag
run: sha1sum concrete-cif.jar | tee -a concrete-cif.jar.sha1
-
name: Create release
if: steps.check-tag.outputs.tag
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
concrete-cif.jar
concrete-cif.jar.sha1
src/main/resources/concrete-cif-1.0.xsd