-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.98 KB
/
Copy pathrelease-aar.yml
File metadata and controls
55 lines (50 loc) · 1.98 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
name: Release AAR
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
name: Build AAR and attach to release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5
with:
distribution: temurin
java-version: "25"
- uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4
- name: Install SDK packages
run: sdkmanager "platforms;android-35" "build-tools;36.0.0"
- name: Build AAR and run unit tests
run: ./gradlew :cobs:testDebugUnitTest :cobs:assembleRelease --console=plain
- name: Stage artifact
id: stage
run: |
version="${GITHUB_REF_NAME#v}"
if [ "$version" = "$GITHUB_REF_NAME" ]; then version="dev"; fi
mkdir -p dist
cp cobs/build/outputs/aar/cobs-release.aar "dist/cobs_codec-${version}.aar"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Upload as workflow artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: cobs_codec-aar-release
path: dist/*.aar
- name: Attach to GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
with:
files: dist/*.aar
name: cobs_codec ${{ steps.stage.outputs.version }}
body: |
Pure-Kotlin **COBS / COBS-R** for Android, packaged as an `.aar`.
Byte-identical to the Dart [`cobs_codec`](https://pub.dev/packages/cobs_codec)
(validated by a 20,000-vector differential test against the reference).
Add to your app:
```kotlin
implementation(files("libs/cobs_codec-${{ steps.stage.outputs.version }}.aar"))
```