Skip to content

Commit 9abc892

Browse files
BREAKING: Replace overcomplicated CI with simple tag-based releases
- Single source of truth: Git tags only - Manual version control: git tag v1.2.3-alpha && git push origin --tags - Automatic build on tag push - No bash version parsing scripts - No multiple version syncing - No race conditions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a1434df commit 9abc892

File tree

4 files changed

+97
-274
lines changed

4 files changed

+97
-274
lines changed

.github/workflows/build.yml

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

.github/workflows/release.yml

Lines changed: 0 additions & 197 deletions
This file was deleted.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Simple Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup Java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: '17'
26+
27+
- name: Setup Android SDK
28+
uses: android-actions/setup-android@v3
29+
30+
- name: Setup Rust
31+
uses: dtolnay/rust-toolchain@stable
32+
with:
33+
targets: aarch64-linux-android
34+
35+
- name: Install cargo-ndk
36+
run: cargo install cargo-ndk
37+
38+
- name: Install Android NDK
39+
run: |
40+
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.1.10909125"
41+
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/26.1.10909125" >> $GITHUB_ENV
42+
echo "ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/26.1.10909125" >> $GITHUB_ENV
43+
44+
- name: Extract version from tag
45+
id: version
46+
run: |
47+
VERSION=${GITHUB_REF#refs/tags/v}
48+
echo "version=$VERSION" >> $GITHUB_OUTPUT
49+
50+
# Update build.gradle to match tag
51+
sed -i "s/version = '[^']*'/version = '$VERSION'/" build.gradle
52+
53+
- name: Run tests
54+
run: cargo test --verbose
55+
56+
- name: Build
57+
run: ./gradlew buildRustJNI assembleRelease
58+
env:
59+
AWS_LC_SYS_NO_ASM_aarch64_linux_android: 1
60+
AWS_LC_SYS_NO_ASM: 1
61+
62+
- name: Publish to GitHub Packages
63+
run: ./gradlew publishReleasePublicationToGitHubPackagesRepository
64+
env:
65+
USERNAME: ${{ github.actor }}
66+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Create GitHub Release
69+
uses: softprops/action-gh-release@v1
70+
with:
71+
files: build/outputs/aar/*.aar
72+
generate_release_notes: true
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
22+
- name: Run tests
23+
run: cargo test --verbose

0 commit comments

Comments
 (0)