-
Notifications
You must be signed in to change notification settings - Fork 100
133 lines (113 loc) · 3.69 KB
/
uniffi.yaml
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
name: UniFFI
env:
UNIFFI_DIRECTORY: bindings/uniffi
on:
# Temporary allow on workflow dispatch
workflow_dispatch:
push:
branches:
- master
tags-ignore:
- '**'
paths:
- '../../bindings/uniffi/**'
- 'core/**'
- 'test-data/**'
- '.github/workflows/uniffi.yaml'
pull_request:
paths:
- '../../bindings/uniffi/**'
- 'core/**'
- 'test-data/**'
- '.github/workflows/uniffi.yaml'
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
fail-fast: true
matrix:
settings:
- host: windows-latest
target: 'x86_64-pc-windows-msvc'
output: 'zen_uniffi.dll'
lib_dir: 'win32-x86-64'
- host: macos-latest
target: 'x86_64-apple-darwin'
output: 'libzen_uniffi.dylib'
lib_dir: 'darwin'
- host: macos-latest
target: 'aarch64-apple-darwin'
output: 'libzen_uniffi.dylib'
lib_dir: 'darwin-aarch64'
- host: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
output: 'libzen_uniffi.so'
lib_dir: 'linux-x86-64'
- host: ubuntu-latest
target: 'aarch64-unknown-linux-gnu'
output: 'libzen_uniffi.so'
lib_dir: 'linux-aarch64'
name: UniFFI - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.settings.target }}
- name: Build
uses: houseabsolute/actions-rust-cross@v1
with:
working-directory: ${{ env.UNIFFI_DIRECTORY }}
target: ${{ matrix.settings.target }}
args: '--lib --release'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.settings.lib_dir }}
path: target/${{ matrix.settings.target }}/release/${{ matrix.settings.output }}
if-no-files-found: error
release-kotlin:
runs-on: ubuntu-latest
needs: [ build ]
# if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi')"
defaults:
run:
working-directory: ${{ env.UNIFFI_DIRECTORY }}
steps:
- uses: actions/checkout@v3
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.settings.target }}
- name: Validate Gradle wrapper jar
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: build/generated/main/resources
- name: Move artifacts
run: mv ../../build ./
- name: Generate Kotlin sources
run: |
cargo run \
--bin uniffi-bindgen \
-- generate \
--library build/generated/main/resources/linux-x86-64/libzen_uniffi.so \
--language kotlin \
--out-dir build/generated/main/kotlin
- name: List current dir
run: ls -a .
- name: Print dependency tree
run: tree build
- name: Print outer folder
run: tree ../../build
# - name: Publish Maven Artifact
# env:
# SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
# SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
# GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
# GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
# run: ./gradlew publishAllPublicationsToCentralPortal