Skip to content

Commit f4471a3

Browse files
committed
Update workflow
1 parent 25c5f70 commit f4471a3

1 file changed

Lines changed: 193 additions & 24 deletions

File tree

Lines changed: 193 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,135 @@
1-
name: Snapshot Deploy
1+
name: Build and Deploy
22

33
on:
44
push:
55
branches: [ main ]
66

77
jobs:
8-
deploy:
9-
runs-on: ubuntu-latest
8+
build-linux:
9+
runs-on: ubuntu-22.04
1010
permissions:
1111
contents: read
1212
packages: write
1313
steps:
14-
- uses: actions/checkout@v4
15-
- name: Setup Java 25
16-
uses: actions/setup-java@v3
17-
with:
18-
java-version: '25'
19-
distribution: 'temurin'
20-
cache: 'maven'
21-
- name: Generate settings.xml
22-
run: |
14+
- uses: actions/checkout@v4
15+
16+
- name: Build native code (Linux)
17+
run: |
18+
cd native && mkdir build && cd build
19+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
20+
make -j4
21+
22+
- name: Set up Java 25
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '25'
26+
distribution: 'temurin'
27+
cache: 'maven'
28+
29+
- name: Generate settings.xml
30+
run: |
31+
cat > ~/.m2/settings.xml << EOF
32+
<settings>
33+
<servers>
34+
<server>
35+
<id>repsy-snapshots</id>
36+
<username>${{ secrets.REPSY_USERNAME }}</username>
37+
<password>${{ secrets.REPSY_PASSWORD }}</password>
38+
</server>
39+
</servers>
40+
</settings>
41+
EOF
42+
43+
- name: Build and deploy
44+
run: |
45+
cd java
46+
set -x
47+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
48+
echo "Detected version: $VERSION"
49+
if [[ $VERSION == *"SNAPSHOT"* ]]; then
50+
echo "Deploying snapshot version: $VERSION"
51+
mvn deploy -U -B
52+
else
53+
echo "Skipping deploy for release version: $VERSION"
54+
mvn install
55+
fi
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
build-macos-x86:
60+
runs-on: macos-13
61+
permissions:
62+
contents: read
63+
packages: write
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Build native code (macOS x86_64)
68+
run: |
69+
cd native && mkdir build && cd build
70+
cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
71+
xcodebuild -project ceffx.xcodeproj -configuration Release
72+
73+
- name: Set up Java 25
74+
uses: actions/setup-java@v4
75+
with:
76+
java-version: '25'
77+
distribution: 'temurin'
78+
cache: 'maven'
79+
80+
- name: Generate settings.xml
81+
run: |
82+
cat > ~/.m2/settings.xml << EOF
83+
<settings>
84+
<servers>
85+
<server>
86+
<id>repsy-snapshots</id>
87+
<username>${{ secrets.REPSY_USERNAME }}</username>
88+
<password>${{ secrets.REPSY_PASSWORD }}</password>
89+
</server>
90+
</servers>
91+
</settings>
92+
EOF
93+
94+
- name: Build and deploy
95+
run: |
96+
cd java
97+
set -x
98+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
99+
echo "Detected version: $VERSION"
100+
if [[ $VERSION == *"SNAPSHOT"* ]]; then
101+
echo "Deploying snapshot version: $VERSION"
102+
mvn deploy -U -B
103+
else
104+
echo "Skipping deploy for release version: $VERSION"
105+
mvn install
106+
fi
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
110+
build-macos-arm64:
111+
runs-on: macos-latest
112+
permissions:
113+
contents: read
114+
packages: write
115+
steps:
116+
- uses: actions/checkout@v4
117+
118+
- name: Build native code (macOS arm64)
119+
run: |
120+
cd native && mkdir build && cd build
121+
cmake -G "Xcode" -DPROJECT_ARCH="arm64" ..
122+
xcodebuild -project ceffx.xcodeproj -configuration Release
123+
124+
- name: Set up Java 25
125+
uses: actions/setup-java@v4
126+
with:
127+
java-version: '25'
128+
distribution: 'temurin'
129+
cache: 'maven'
130+
131+
- name: Generate settings.xml
132+
run: |
23133
cat > ~/.m2/settings.xml << EOF
24134
<settings>
25135
<servers>
@@ -31,16 +141,75 @@ jobs:
31141
</servers>
32142
</settings>
33143
EOF
34-
- name: Deploy only snapshot versions
35-
run: |
36-
set -x
37-
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
38-
echo "Detected version: $VERSION"
39-
if [[ $VERSION == *"SNAPSHOT"* ]]; then
40-
echo "Deploying snapshot version: $VERSION"
41-
mvn deploy -U -B
42-
else
43-
echo "Skipping deploy for release version: $VERSION"
44-
fi
45-
env:
144+
145+
- name: Build and deploy
146+
run: |
147+
cd java
148+
set -x
149+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
150+
echo "Detected version: $VERSION"
151+
if [[ $VERSION == *"SNAPSHOT"* ]]; then
152+
echo "Deploying snapshot version: $VERSION"
153+
mvn deploy -U -B
154+
else
155+
echo "Skipping deploy for release version: $VERSION"
156+
mvn install
157+
fi
158+
env:
46159
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160+
161+
build-windows:
162+
runs-on: windows-latest
163+
permissions:
164+
contents: read
165+
packages: write
166+
steps:
167+
- uses: actions/checkout@v4
168+
169+
- name: Build native code (Windows)
170+
run: |
171+
cd native
172+
mkdir build
173+
cd build
174+
cmake -G "Visual Studio 17" -A x64 ..
175+
cmake --build . --config Release
176+
177+
- name: Set up Java 25
178+
uses: actions/setup-java@v4
179+
with:
180+
java-version: '25'
181+
distribution: 'temurin'
182+
cache: 'maven'
183+
184+
- name: Generate settings.xml
185+
shell: pwsh
186+
run: |
187+
$xml = @"
188+
<settings>
189+
<servers>
190+
<server>
191+
<id>repsy-snapshots</id>
192+
<username>${{ secrets.REPSY_USERNAME }}</username>
193+
<password>${{ secrets.REPSY_PASSWORD }}</password>
194+
</server>
195+
</servers>
196+
</settings>
197+
"@
198+
New-Item -ItemType Directory -Force -Path "$HOME/.m2"
199+
$xml | Set-Content "$HOME/.m2/settings.xml"
200+
201+
- name: Build and deploy
202+
shell: pwsh
203+
run: |
204+
cd java
205+
$VERSION = mvn help:evaluate -Dexpression=project.version -q -DforceStdout
206+
Write-Host "Detected version: $VERSION"
207+
if ($VERSION -like "*SNAPSHOT*") {
208+
Write-Host "Deploying snapshot version: $VERSION"
209+
mvn deploy -U -B
210+
} else {
211+
Write-Host "Skipping deploy for release version: $VERSION"
212+
mvn install
213+
}
214+
env:
215+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)