forked from ankidroid/Anki-Android-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 3.12 KB
/
publish_testing.yml
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
# Note: this is copied from robolectric_build.yml
name: Publish JAR for Robolectric Testing
on: workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force
- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31
- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2
- name: Install NDK
run: .github/scripts/install_ndk.sh 22.0.7026061
# install cargo
- name: Install Rust
uses: actions-rs/[email protected]
with:
toolchain: 1.54.0
override: true
components: rustfmt
# actions-rs only accepts "target" (although a "targets" param to be added in v2). We need 7 targets.
- name: Install Rust Targets
run: .github/scripts/install_rust_robolectric_targets.sh
- name: Install x86_64-w64-mingw32-gcc
run: brew install mingw-w64 && x86_64-w64-mingw32-gcc -v
- name: Install x86_64-unknown-linux-gnu
run: |
brew tap SergioBenitez/osxct
brew install x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnu-gcc -v
- name: Build JAR
run: |
export ANKIDROID_LINUX_CC=x86_64-unknown-linux-gnu-gcc
export ANKIDROID_MACOS_CC=cc
export RUST_DEBUG=1
export RUST_BACKTRACE=1
export RUST_LOG=trace
export NO_CROSS=true
./gradlew clean rsdroid-testing:build -Dorg.gradle.project.macCC=$ANKIDROID_MACOS_CC -DtestBuildType=debug -Dorg.gradle.daemon=false -Dorg.gradle.console=plain
- name: Check Compiled Libraries
run: >
cd rsdroid-testing/assets &&
../../.github/scripts/check_robolectric_assets.sh
- name: Upload rsdroid-testing JAR as artifact
uses: actions/upload-artifact@v2
with:
name: rsdroid-testing
if-no-files-found: error
path: rsdroid-testing/build/libs
- name: Publish JAR to Maven
env:
ORG_GRADLE_PROJECT_SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_NEXUS_USERNAME: david-allison-1
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run: |
export ANKIDROID_LINUX_CC=x86_64-unknown-linux-gnu-gcc
export ANKIDROID_MACOS_CC=cc
export RUST_DEBUG=1
export RUST_BACKTRACE=1
export RUST_LOG=trace
export NO_CROSS=true
./gradlew rsdroid-testing:uploadArchives -Dorg.gradle.project.macCC=$ANKIDROID_MACOS_CC -DtestBuildType=debug -Dorg.gradle.daemon=false -Dorg.gradle.console=plain
- name: ℹ️Additional Release Instructions (requires human interaction)
run: echo "Sign in to https://oss.sonatype.org/#stagingRepositories , close the repsository, then release it"