Repository navigation
55 lines (46 loc) · 1.6 KB
/
Copy pathbuild.yml
File metadata and controls
55 lines (46 loc) · 1.6 KB
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
name: Build
on:
push:
pull_request:
schedule:
# Daily run against the newest CraftEngine snapshot to catch upstream API churn early (§2).
- cron: "17 4 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build (CraftEngine ${{ matrix.craftengine }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
craftengine: [pinned, latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
21
25
- uses: gradle/actions/setup-gradle@v4
- name: Resolve newest CraftEngine snapshot
if: matrix.craftengine == 'latest'
run: |
version=$(curl -fsSL https://repo.momirealms.net/snapshots/net/momirealms/craft-engine-core/maven-metadata.xml \
| grep -oP '(?<=<version>)[^<]+(?=</version>)' | sort -V | tail -n 1)
echo "Newest CraftEngine snapshot: $version"
echo "CE_ARGS=-Pcraftengine_version=$version" >> "$GITHUB_ENV"
- name: Build and test
run: ./gradlew build ${CE_ARGS:-} --console=plain
# API compatibility (§5): against the last released API; the report is in api/build/reports/japicmp.
- name: Check API binary compatibility
if: matrix.craftengine == 'pinned'
run: ./gradlew :api:japicmp --console=plain
- name: Upload plugin jar
if: matrix.craftengine == 'pinned'
uses: actions/upload-artifact@v4
with:
name: MachineEngine
path: plugin/build/libs/MachineEngine-*.jar