-
Notifications
You must be signed in to change notification settings - Fork 416
162 lines (148 loc) · 6 KB
/
rebuild.yaml
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
name: Rebuild
on:
schedule:
- cron: 0 0 * * *
jobs:
rebuild:
name: Rebuild
runs-on: ubuntu-22.04
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
branch:
- '3.27'
- '3.28'
- '3.29'
- '3.30'
steps:
- run: docker system prune --all --force
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Get tag
id: tag2
uses: frabert/[email protected]
with:
pattern: refs/tags/(.*)
string: '{{ github.ref }}'
replace-with: $1
if: startsWith(github.ref, 'refs/tags/')
- run: echo --${{ steps.tag2.outputs.replaced }}--
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: docker
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
- id: last-tag
run: echo "tag=$(git describe --tags --abbrev=0)" > $GITHUB_OUTPUT
- id: no-tag
run: echo "nb=$(git log --oneline ${{ steps.last-tag.outputs.tag }}..HEAD|wc -l)" > $GITHUB_OUTPUT
- run: sed --in-place 's/version = .*/version = "${{ steps.last-tag.outputs.tag }}"/g' build.gradle
if: steps.no-tag.outputs.nb == 0
- run:
sed --in-place 's/version = .*/version = "${{ steps.last-tag.outputs.tag }}+${{ steps.no-tag.outputs.nb
}}"/g' build.gradle
if: steps.no-tag.outputs.nb > 0
- run: echo "enablePublishing=true" > gradle.properties
- run: git diff
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt
- run: make build
# Extract artifacts
- run: docker run --rm --detach --name=builder mapfish_print_builder
if: always()
- run: docker cp builder:/src/core/build/ core/build/
if: always()
- uses: actions/upload-artifact@v4
with:
name: Test results
path: core/build/resources/actual
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Reports core
path: core/build/reports
if: failure()
- name: Collect test results
run: |
mkdir -p /tmp/test_results/junit
find . -name '*TEST-*.xml' -exec cp -v {} /tmp/test_results/junit/ \;
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Test results
path: /tmp/test_results
if: failure()
- name: Publish
run: c2cciutils-publish --type=rebuild --branch=${{ matrix.branch }}
- run: ./gradlew :core:libSourcesJar
if: startsWith(github.ref, 'refs/tags/')
- run: ./gradlew :core:libJavadocJar
if: startsWith(github.ref, 'refs/tags/')
- id: version
run: echo "version=$(grep 'version = ' build.gradle|sed "s/ \+version = .\(.*\)./\1/g")" > $GITHUB_OUTPUT
- id: tag
run: echo "tag=$(echo github.ref|sed 's%refs/tags/%%g')" > $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.tag.outputs.tag }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-servlet-${{ steps.version.outputs.version }}.war
asset_name: print-servlet-${{ steps.version.outputs.version }}.war
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/distributions/core-${{ steps.version.outputs.version }}.zip
asset_name: print-cli-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}.jar
asset_name: print-lib-${{ steps.version.outputs.version }}.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-sources.jar
asset_name: print-lib-${{ steps.version.outputs.version }}-sources.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-javadoc.jar
asset_name: print-lib-${{ steps.version.outputs.version }}-javadoc.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')