-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (95 loc) · 4.01 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Build
on: push
jobs:
env:
name: Environment consistency checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- id: version
name: Ensure version number is consistent with branch type
run: make version-check
test:
strategy:
matrix:
java-version: [ 17, 21 ]
name: Test ${{ matrix.java-version }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Build application
run: ./mvnw --batch-mode verify -Pall-assemblies
- name: Re-run integration tests in opaque testing mode
run: ./mvnw --batch-mode verify -Pall-assemblies -DopaqueTesting=true
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: target/surefire-reports/TEST-*.xml
- name: Upload test reports
uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports-with-jdk-${{ matrix.java-version }}
path: |
target/surefire-reports/
- name: Test standalone symly version
run: |
target/distributions/symly-*-standalone/bin/symly --version
target/distributions/symly-*-standalone/bin/symly --help
release:
name: Release
if: startsWith(github.ref, 'refs/heads/release/')
needs: [ env, test ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# required for jreleaser to properly compare tags and generate the changelog
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- id: read-version
run: |
VERSION=$(make version)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build application
run: ./mvnw --batch-mode verify -Pall-assemblies
- name: Run JReleaser
env:
JRELEASER_PROJECT_VERSION: ${{ steps.read-version.outputs.version }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ secrets.SYMLY_PUBLISH_REPOS_TOKEN }}
run: ./mvnw -Pjreleaser jreleaser:full-release
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
target/jreleaser/output.properties
target/jreleaser/trace.log
target/jreleaser/release/CHANGELOG.md
- id: publish
env:
REPO_FEDORA_COPR_SYMLY_USERNAME: loicrouchon
REPO_FEDORA_COPR_SYMLY_PASSWORD: ${{ secrets.SYMLY_PUBLISH_REPOS_TOKEN }}
REPO_SYMLY_DEBIAN_USERNAME: loicrouchon
REPO_SYMLY_DEBIAN_PASSWORD: ${{ secrets.SYMLY_PUBLISH_REPOS_TOKEN }}
run: |
git config --global user.email "noreply@github.com"
git config --global user.name "GitHub CI publisher bot"
make publish