-
-
Notifications
You must be signed in to change notification settings - Fork 48
152 lines (133 loc) · 4.45 KB
/
maven.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
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
name: Main Maven build
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/maven.yml
- .github/project.yml
- "**.xml"
- "*.yml"
- "src/**"
- "ide-config"
env:
JAVA_VERSION: 17
JAVA_DISTRO: temurin
NATIVE_JAVA_VERSION: 23
GRAALVM_DIST: graalvm-community
GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_BOT_NAME: "GitHub Action"
permissions: read-all
jobs:
main_root:
runs-on: ubuntu-latest
outputs:
is_main: ${{ steps.is_main_root.outputs.is_main }}
steps:
- name: Echo a message
id: is_main_root
if: github.ref == 'refs/heads/main' && github.repository == 'ebullient/ttrpg-convert-cli'
run: |
echo "This is the main branch of 'ebullient/ttrpg-convert-cli'"
echo "is_main=true" >> $GITHUB_OUTPUT
metadata:
uses: ebullient/workflows/.github/workflows/java-snap-metadata.yml@main
tools5e_cache:
uses: ./.github/workflows/tools5e-data-cache.yml
pf2e_cache:
uses: ./.github/workflows/pf2e-data-cache.yml
build:
runs-on: ubuntu-latest
needs: [main_root, metadata, tools5e_cache, pf2e_cache]
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
fetch-tags: false
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: tools5e-cache-load
with:
path: sources
key: ${{ needs.tools5e_cache.outputs.cache_key }}
restore-keys: |
Data-5etools-
Data-5etools
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: pf2e-cache-load
with:
path: sources/Pf2eTools
key: ${{ needs.pf2e_cache.outputs.cache_key }}
restore-keys: |
Data-Pf2eTools-
Data-Pf2eTools
- name: Build with Maven
uses: ebullient/workflows/.github/actions/maven-build@main
with:
artifact: ${{ needs.metadata.outputs.artifact }}
version: ${{ needs.metadata.outputs.snapshot }}
java-version: ${{ env.JAVA_VERSION }}
java-distribution: ${{ env.JAVA_DISTRO }}
- name: Push changes to files
if: needs.main_root.outputs.is_main
uses: ebullient/workflows/.github/actions/push-changes@main
with:
files: "README.md README-WINDOWS.md docs"
native-build:
needs: [metadata, tools5e_cache, pf2e_cache, build]
name: Build ${{ matrix.os }} binary
runs-on: ${{ matrix.os }}
concurrency:
group: native-${{ matrix.os }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [macos-13, macos-latest, windows-latest, ubuntu-latest]
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: tools5e-cache-load
with:
path: sources
key: ${{ needs.tools5e_cache.outputs.cache_key }}
restore-keys: |
Data-5etools-
Data-5etools
enableCrossOsArchive: true
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: pf2e-cache-load
with:
path: sources/Pf2eTools
key: ${{ needs.pf2e_cache.outputs.cache_key }}
restore-keys: |
Data-Pf2eTools-
Data-Pf2eTools
enableCrossOsArchive: true
- name: Native build with Maven
uses: ebullient/workflows/.github/actions/native-build@main
with:
artifact: ${{ needs.metadata.outputs.artifact }}
version: ${{ needs.metadata.outputs.snapshot }}
native-java-version: ${{ env.NATIVE_JAVA_VERSION }}
distribution: ${{ env.GRAALVM_DIST }}
matrix-os: ${{ matrix.os }}
snap-release:
needs: [main_root, metadata, build, native-build]
if: needs.main_root.outputs.is_main
uses: ebullient/workflows/.github/workflows/java-snapshot.yml@main
permissions:
contents: write
with:
artifact: ${{ needs.metadata.outputs.artifact }}
snapshot: ${{ needs.metadata.outputs.snapshot }}
secrets: inherit