Skip to content

Commit 44bedfa

Browse files
authored
Merge pull request #20 from moi15moi/Add-CI
Add CI to publish the project to Maven Central Repository + run tests
2 parents 24e3dde + 8143737 commit 44bedfa

3 files changed

Lines changed: 68 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to Maven Central Repository
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-package:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v5
13+
with:
14+
submodules: recursive
15+
16+
- name: Run setup-libraries composite action
17+
uses: ./lib_ass/src/main/cpp/libass-cmake/.github/actions/setup-libraries
18+
with:
19+
libass-cmake-path: ${{ github.workspace }}/lib_ass/src/main/cpp/libass-cmake
20+
21+
- name: Publish to Maven Central Repository
22+
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
23+
env:
24+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USER_NAME }}
25+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }}
28+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
run-tests:
10+
name: "Test (${{ matrix.arch }})"
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
arch: ["x86", "x86_64"]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v5
20+
with:
21+
submodules: recursive
22+
23+
- name: Run setup-libraries composite action
24+
uses: ./lib_ass/src/main/cpp/libass-cmake/.github/actions/setup-libraries
25+
with:
26+
libass-cmake-path: ${{ github.workspace }}/lib_ass/src/main/cpp/libass-cmake
27+
28+
- name: Enable KVM
29+
run: |
30+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
31+
sudo udevadm control --reload-rules
32+
sudo udevadm trigger --name-match=kvm
33+
34+
- name: Run tests
35+
uses: reactivecircus/android-emulator-runner@v2
36+
with:
37+
api-level: 21
38+
arch: ${{ matrix.arch }}
39+
script: ./gradlew test connectedAndroidTest

0 commit comments

Comments
 (0)