-
Notifications
You must be signed in to change notification settings - Fork 225
189 lines (188 loc) · 6.85 KB
/
Copy pathbuild.yml
File metadata and controls
189 lines (188 loc) · 6.85 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: CI build
on:
push:
branches:
- master
- staging
- r[0-9]+.*
pull_request:
branches:
- master
- r[0-9]+.*
types: [opened, reopened, synchronize, labeled, unlabeled]
env:
DEPLOY: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r')) }}
jobs:
check-format:
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
steps:
- name: Configure Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '17'
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Build project
run: |
gcc --version
mvn -version
mvn clean install -Pjdk17 -B -U -e -Dlint.skip=true -Dmaven.test.skip=true
- name: Run format checks
run: |
mvn spotless:check -Pjdk17 -B -U -e
linux-arm64:
runs-on: ubuntu-2204-arm64-2c
strategy:
matrix:
ext: [""]
steps:
- name: Install environment
run: |
sudo apt update
sudo apt install -y curl wget unzip tar git gcc g++
- name: Configure Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
architecture: 'aarch64'
- name: Checkout repository
uses: actions/checkout@v6
- name: Build project
run: |
gcc --version
mvn -version
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Build native artifact
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Upload native artifact
if: env.DEPLOY == 'true'
uses: actions/upload-artifact@v7
with:
name: native-artifact-${{ github.job }}${{ matrix.ext }}
path: tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar
if-no-files-found: error
retention-days: 1
linux-x86_64:
runs-on: ubuntu-22.04
strategy:
matrix:
ext: ["", -gpu]
steps:
- name: Configure Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '11'
- name: Checkout repository
uses: actions/checkout@v6
- name: Build project
run: |
gcc --version
mvn -version
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Build native artifact
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Upload native artifact
if: env.DEPLOY == 'true'
uses: actions/upload-artifact@v7
with:
name: native-artifact-${{ github.job }}${{ matrix.ext }}
path: tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar
if-no-files-found: error
retention-days: 1
macosx-arm64:
runs-on: macos-14
strategy:
matrix:
ext: [""]
steps:
- name: Configure Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
architecture: 'arm64'
- name: Checkout repository
uses: actions/checkout@v6
- name: Build project
run: |
clang --version
mvn -version
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Build native artifact
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Upload native artifact
if: env.DEPLOY == 'true'
uses: actions/upload-artifact@v7
with:
name: native-artifact-${{ github.job }}${{ matrix.ext }}
path: tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar
if-no-files-found: error
retention-days: 1
deploy:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs: [linux-x86_64, macosx-arm64, linux-arm64]
runs-on: ubuntu-22.04
steps:
- name: Configure Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '11'
server-id: central
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
- name: Checkout repository
uses: actions/checkout@v6
- name: Download native artifacts
uses: actions/download-artifact@v8
with:
pattern: native-artifact-*
path: tensorflow-core/tensorflow-core-native/target
merge-multiple: true
- name: Build and Deploy snapshot artifacts
env:
MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.CI_DEPLOY_PASSWORD }}
run: |
java -version
mvn -version
mvn deploy -Pdeploying -B -e
release:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }}
needs: [linux-x86_64, macosx-arm64, linux-arm64]
runs-on: ubuntu-22.04
steps:
- name: Configure Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '11'
server-id: central
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE # Handled as an env variable name reference
- name: Checkout repository
uses: actions/checkout@v6
- name: Download native artifacts
uses: actions/download-artifact@v8
with:
pattern: native-artifact-*
path: tensorflow-core/tensorflow-core-native/target
merge-multiple: true
- name: Build and Deploy release artifacts
env:
MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.CI_DEPLOY_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
run: |
java -version
mvn -version
mvn deploy -Pdeploying -Preleasing -B -e