Skip to content

Commit 1909525

Browse files
committed
Add GitHub Actions stuff
1 parent a967ac0 commit 1909525

File tree

1 file changed

+130
-0
lines changed

1 file changed

+130
-0
lines changed

.github/workflows/ci.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Gradle CI
2+
3+
on:
4+
- push
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build-linux:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
# Taken from https://github.com/CaffeineMC/sodium-fabric/blob/1.19.3/dev/.github/workflows/gradle.yml
21+
- name: Cache/Uncache
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/loom-cache
27+
~/.gradle/wrapper
28+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
29+
restore-keys: |
30+
${{ runner.os }}-gradle-
31+
- name: Build artifacts
32+
run: ./gradlew :native:jar
33+
- name: Upload build artifacts
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: Linux x86-64 Targets
37+
path: native/target/*
38+
# name: Linux x86-64 Natives
39+
# path: native/build/libs/UnityTranslateLib-*.jar
40+
build-linux-arm64:
41+
environment: UnityTranslate Build
42+
runs-on: ubuntu-24.04-arm
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Set up JDK 17
47+
uses: actions/setup-java@v3
48+
with:
49+
java-version: '17'
50+
distribution: 'temurin'
51+
# Taken from https://github.com/CaffeineMC/sodium-fabric/blob/1.19.3/dev/.github/workflows/gradle.yml
52+
- name: Cache/Uncache
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
~/.gradle/caches
57+
~/.gradle/loom-cache
58+
~/.gradle/wrapper
59+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
60+
restore-keys: |
61+
${{ runner.os }}-gradle-
62+
- name: Build artifacts
63+
run: ./gradlew :native:jar
64+
- name: Upload build artifacts
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: Linux arm64 Targets
68+
path: native/target/*
69+
# name: Linux arm64 Natives
70+
# path: native/build/libs/UnityTranslateLib-*.jar
71+
build-osx:
72+
environment: UnityTranslate Build
73+
runs-on: macos-latest
74+
75+
steps:
76+
- uses: actions/checkout@v4
77+
- name: Set up JDK 17
78+
uses: actions/setup-java@v3
79+
with:
80+
java-version: '17'
81+
distribution: 'temurin'
82+
# Taken from https://github.com/CaffeineMC/sodium-fabric/blob/1.19.3/dev/.github/workflows/gradle.yml
83+
- name: Cache/Uncache
84+
uses: actions/cache@v4
85+
with:
86+
path: |
87+
~/.gradle/caches
88+
~/.gradle/loom-cache
89+
~/.gradle/wrapper
90+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
91+
restore-keys: |
92+
${{ runner.os }}-gradle-
93+
- name: Build artifacts
94+
run: ./gradlew :native:jar
95+
- name: Upload build artifacts
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: macOS arm64 Targets
99+
path: native/target/*
100+
# name: macOS arm64 Natives
101+
# path: native/build/libs/UnityTranslateLib-*.jar
102+
build-windows:
103+
environment: UnityTranslate Build
104+
runs-on: windows-latest
105+
106+
steps:
107+
- uses: actions/checkout@v4
108+
- name: Set up JDK 17
109+
uses: actions/setup-java@v3
110+
with:
111+
java-version: '17'
112+
distribution: 'temurin'
113+
# Taken from https://github.com/CaffeineMC/sodium-fabric/blob/1.19.3/dev/.github/workflows/gradle.yml
114+
- name: Cache/Uncache
115+
uses: actions/cache@v4
116+
with:
117+
path: |
118+
~/.gradle/caches
119+
~/.gradle/loom-cache
120+
~/.gradle/wrapper
121+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
122+
restore-keys: |
123+
${{ runner.os }}-gradle-
124+
- name: Build artifacts
125+
run: ./gradlew :native:jar
126+
- name: Upload build artifacts
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: Windows x86-64 Natives
130+
path: native/build/libs/UnityTranslateLib-*.jar

0 commit comments

Comments
 (0)