Skip to content

Commit e4c5d57

Browse files
committed
Fix CI triggers for better_workflow and simplify OS-specific steps
1 parent 9b5d509 commit e4c5d57

File tree

3 files changed

+19
-81
lines changed

3 files changed

+19
-81
lines changed

.github/workflows/macos-build.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: macOS Build
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "master", "better_workflow" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "master", "better_workflow" ]
88

99
permissions:
1010
contents: read
@@ -150,28 +150,18 @@ jobs:
150150
ndk-version: ${{ matrix.ndk }}
151151
link-to-sdk: true
152152
add-to-path: true
153-
154-
- name: Install build tools (Ubuntu)
155-
if: runner.os == 'Linux'
156-
run: sudo apt-get update && sudo apt-get install -y ninja-build
157-
158-
- name: Install build tools (macOS)
159-
if: runner.os == 'macOS'
153+
154+
- name: Install build tools
160155
run: brew install ninja
161156

162-
- name: Install build tools (Windows)
163-
if: runner.os == 'Windows'
164-
run: choco install ninja
165-
166157
- name: Setup JDK 17
167158
uses: actions/setup-java@v3
168159
with:
169160
java-version: '17'
170161
distribution: 'temurin'
171162
cache: gradle
172163

173-
- name: Grant execute permission for scripts (Unix)
174-
if: runner.os != 'Windows'
164+
- name: Grant execute permission for scripts
175165
run: chmod +x gradlew tasks.sh
176166

177167
- name: Configure build parameters
@@ -214,21 +204,11 @@ jobs:
214204
- name: Setup project (ndk-build mode)
215205
if: matrix.build-system == 'ndk-build'
216206
shell: bash
217-
run: |
218-
if [ "${{ runner.os }}" == "Windows" ]; then
219-
bash tasks.sh --setup-project
220-
else
221-
./tasks.sh --setup-project
222-
fi
207+
run: ./tasks.sh --setup-project
223208

224209
- name: Build APK
225210
shell: bash
226-
run: |
227-
if [ "${{ runner.os }}" == "Windows" ]; then
228-
bash tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
229-
else
230-
./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
231-
fi
211+
run: ./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
232212

233213
- name: Find and rename APK
234214
shell: bash

.github/workflows/ubuntu-build.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Ubuntu Build
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "master", "better_workflow" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "master", "better_workflow" ]
88

99
permissions:
1010
contents: read
@@ -149,18 +149,9 @@ jobs:
149149
link-to-sdk: true
150150
add-to-path: true
151151

152-
- name: Install build tools (Ubuntu)
153-
if: runner.os == 'Linux'
152+
- name: Install build tools
154153
run: sudo apt-get update && sudo apt-get install -y ninja-build
155154

156-
- name: Install build tools (macOS)
157-
if: runner.os == 'macOS'
158-
run: brew install ninja
159-
160-
- name: Install build tools (Windows)
161-
if: runner.os == 'Windows'
162-
run: choco install ninja
163-
164155
- name: Setup JDK 17
165156
uses: actions/setup-java@v3
166157
with:
@@ -212,21 +203,11 @@ jobs:
212203
- name: Setup project (ndk-build mode)
213204
if: matrix.build-system == 'ndk-build'
214205
shell: bash
215-
run: |
216-
if [ "${{ runner.os }}" == "Windows" ]; then
217-
bash tasks.sh --setup-project
218-
else
219-
./tasks.sh --setup-project
220-
fi
206+
run: ./tasks.sh --setup-project
221207

222208
- name: Build APK
223209
shell: bash
224-
run: |
225-
if [ "${{ runner.os }}" == "Windows" ]; then
226-
bash tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
227-
else
228-
./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
229-
fi
210+
run: ./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
230211

231212
- name: Find and rename APK
232213
shell: bash
@@ -248,7 +229,7 @@ jobs:
248229
lint:
249230
name: Lint
250231
runs-on: ubuntu-latest
251-
if: github.ref == 'refs/heads/master'
232+
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/better_workflow'
252233

253234
steps:
254235
- name: Checkout code

.github/workflows/windows-build.yml

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Windows Build
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "master", "better_workflow" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "master", "better_workflow" ]
88

99
permissions:
1010
contents: read
@@ -150,17 +150,8 @@ jobs:
150150
ndk-version: ${{ matrix.ndk }}
151151
link-to-sdk: true
152152
add-to-path: true
153-
154-
- name: Install build tools (Ubuntu)
155-
if: runner.os == 'Linux'
156-
run: sudo apt-get update && sudo apt-get install -y ninja-build
157-
158-
- name: Install build tools (macOS)
159-
if: runner.os == 'macOS'
160-
run: brew install ninja
161-
162-
- name: Install build tools (Windows)
163-
if: runner.os == 'Windows'
153+
154+
- name: Install build tools
164155
run: choco install ninja
165156

166157
- name: Setup JDK 17
@@ -170,10 +161,6 @@ jobs:
170161
distribution: 'temurin'
171162
cache: gradle
172163

173-
- name: Grant execute permission for scripts (Unix)
174-
if: runner.os != 'Windows'
175-
run: chmod +x gradlew tasks.sh
176-
177164
- name: Configure build parameters
178165
shell: bash
179166
run: |
@@ -214,21 +201,11 @@ jobs:
214201
- name: Setup project (ndk-build mode)
215202
if: matrix.build-system == 'ndk-build'
216203
shell: bash
217-
run: |
218-
if [ "${{ runner.os }}" == "Windows" ]; then
219-
bash tasks.sh --setup-project
220-
else
221-
./tasks.sh --setup-project
222-
fi
204+
run: bash tasks.sh --setup-project
223205

224206
- name: Build APK
225207
shell: bash
226-
run: |
227-
if [ "${{ runner.os }}" == "Windows" ]; then
228-
bash tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
229-
else
230-
./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
231-
fi
208+
run: bash tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
232209

233210
- name: Find and rename APK
234211
shell: bash

0 commit comments

Comments
 (0)