-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (139 loc) · 4.37 KB
/
Copy pathgradle.yml
File metadata and controls
160 lines (139 loc) · 4.37 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build
on:
push:
branches: [ '*' ]
tags: [ '*' ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-macos:
name: Build macOS Native Libraries
strategy:
matrix:
include:
- os: macos-26 # Apple Silicon runner
classifier: macos-arm64
- os: macos-15-intel # Intel runner
classifier: macos-x86_64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-tags: 'true'
fetch-depth: '0'
submodules: recursive
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Install dependencies
run: |
brew update
brew uninstall cmake
brew install cmake conan
conan --version
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Verify architecture
run: |
echo "Running on: $(uname -m)"
echo "Classifier: ${{ matrix.classifier }}"
- name: Build native library for host
run: ./gradlew compileNativeForHost
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: libdatachannel-${{ matrix.classifier }}
path: |
build/dockcross/host/native/libdatachannel-java.dylib
build/dockcross/host/native/libmimalloc*.dylib
retention-days: 30
if-no-files-found: error
build:
needs:
- build-macos
- build-ios
runs-on: ubuntu-latest
environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && 'sonatype-central' || null }}
steps:
- uses: actions/checkout@v6
with:
fetch-tags: 'true'
fetch-depth: '0'
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Download macOS ARM64 artifacts
uses: actions/download-artifact@v7
with:
name: libdatachannel-macos-arm64
path: artifacts/macos-arm64/
- name: Download macOS x86_64 artifacts
uses: actions/download-artifact@v7
with:
name: libdatachannel-macos-x86_64
path: artifacts/macos-x86_64/
- name: Download iOS artifacts
uses: actions/download-artifact@v7
with:
name: libdatachannel-ios
path: artifacts/ios/
- name: Build
run: |
prebuilts=(
-Plibdatachannel.macos-arm64.prebuilt-path=artifacts/macos-arm64/libdatachannel-java.dylib
-Plibdatachannel.macos-x86_64.prebuilt-path=artifacts/macos-x86_64/libdatachannel-java.dylib
-Plibdatachannel.ios.prebuilt-path=artifacts/ios
)
./gradlew --no-configuration-cache :githubActions "${prebuilts[@]}"
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_mavenCentralSnapshotsUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralSnapshotsPassword: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_CENTRAL_PORTAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_PORTAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
LIBDATACHANNEL_JAVA_GROUP_OVERRIDE: ${{ vars.LIBDATACHANNEL_JAVA_GROUP_OVERRIDE }}
build-ios:
name: Build iOS Native Frameworks
runs-on: macos-26
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-tags: 'true'
fetch-depth: '0'
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Install dependencies
run: |
brew update
brew uninstall cmake
brew install cmake conan
conan --version
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Build iOS xcframework
run: ./gradlew --no-configuration-cache compileNativeForIos
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: libdatachannel-ios
path: build/dockcross/ios/native/lib/ios/
retention-days: 30
if-no-files-found: error