Skip to content

Commit cd8d10f

Browse files
committed
Consolidate android into single step (#215)
1 parent 683f1c1 commit cd8d10f

File tree

6 files changed

+17
-127
lines changed

6 files changed

+17
-127
lines changed

.github/workflows/build-libs.yml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -160,39 +160,15 @@ jobs:
160160
path: ./libs/ios/*
161161

162162
build_android:
163-
name: Android-arm
163+
name: Android
164164
if: "! contains(github.event.head_commit.message, '[skip ci]')"
165165
runs-on: ubuntu-latest
166166
steps:
167-
- name: Checkout
168-
uses: actions/checkout@v1
169-
with:
170-
submodules: "true"
167+
- uses: actions/checkout@v1
171168

172-
- name: Run build script
173-
run: ./devops/BuildLibraries.ps1 -Platform Android-ARM -OutLocation ./libs/android
169+
- run: ./devops/BuildLibraries.ps1 -Platform Android -OutLocation ./libs/android
174170
shell: pwsh
175-
- name: Upload Android artifact
176-
uses: actions/upload-artifact@v2
177-
with:
178-
name: android-arm
179-
path: ./libs/android/*
180-
181-
build_android_x86:
182-
name: Android-x86
183-
if: "! contains(github.event.head_commit.message, '[skip ci]')"
184-
runs-on: ubuntu-latest
185-
steps:
186-
- name: Checkout
187-
uses: actions/checkout@v1
188-
with:
189-
submodules: "true"
190-
191-
- name: Run build script
192-
run: ./devops/BuildLibraries.ps1 -Platform Android-x86 -OutLocation ./libs/android
193-
shell: pwsh
194-
- name: Upload Android artifact
195-
uses: actions/upload-artifact@v2
171+
- uses: actions/upload-artifact@v2
196172
with:
197-
name: android-x86
198-
path: ./libs/android/*
173+
name: android
174+
path: ./libs/android/*

.github/workflows/release-libs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ jobs:
4848
path: ./libs
4949
branch: main
5050
- run: |
51-
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' | ConvertFrom-Json
51+
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' `
52+
-Headers @{ "Authorization" = "Token $env:API_GITHUB_TOKEN"} | ConvertFrom-Json
5253
$version = $json.tag_name
5354
echo "RELEASE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
5455
shell: pwsh
56+
env:
57+
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
5558
- name: Push packages to release
5659
uses: svenstaro/upload-release-action@v2
5760
if: github.event_name == 'release'
@@ -75,10 +78,13 @@ jobs:
7578
- run: Compress-Archive -Path ./libs -DestinationPath ./libs.zip
7679
shell: pwsh
7780
- run: |
78-
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' | ConvertFrom-Json
81+
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' `
82+
-Headers @{ "Authorization" = "Token $env:API_GITHUB_TOKEN"} | ConvertFrom-Json
7983
$version = $json.tag_name
8084
echo "RELEASE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
8185
shell: pwsh
86+
env:
87+
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
8288
- uses: svenstaro/upload-release-action@v2
8389
with:
8490
repo_token: ${{ secrets.GITHUB_TOKEN }}

.vscode/extensions.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

devops/BuildLibraries.ps1

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
param
22
(
3-
[ValidateSet('Windows', 'Windows-GNU', 'MacOS', 'Linux', 'Linux-ARM', 'iOS', 'Android-x86', 'Android-ARM')]
3+
[ValidateSet('Windows', 'Windows-GNU', 'MacOS', 'Linux', 'Linux-ARM', 'iOS', 'Android')]
44
$Platform,
55
$OutLocation,
66
$AndroidNdkHome
@@ -91,15 +91,10 @@ try {
9191
Copy-Item -Path "./target/aarch64-apple-ios/release/libokapi.a" -Destination "$TargetOutput/libokapi.a"
9292
break
9393
}
94-
Android-ARM {
94+
Android {
9595
cargo install cargo-ndk
96-
rustup target add aarch64-linux-android armv7-linux-androideabi
96+
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
9797
cargo ndk --target armv7-linux-androideabi --target aarch64-linux-android -o "$TargetOutput" build --release
98-
break
99-
}
100-
Android-x86 {
101-
cargo install cargo-ndk
102-
rustup target add i686-linux-android x86_64-linux-android
10398
cargo ndk --target x86_64-linux-android --target i686-linux-android -o "$TargetOutput" build --release
10499
break
105100
}

0 commit comments

Comments
 (0)