add pipelines for release

This commit is contained in:
Stefan
2025-07-25 07:28:31 +02:00
parent 8d84f547f3
commit 91f86d63d0
5 changed files with 81 additions and 4 deletions
@@ -0,0 +1,56 @@
name: "Release: Uniffi"
env:
WORKING_DIRECTORY: bindings/uniffi
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
publish:
name: Version
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIRECTORY }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set Git author
run: |
git config user.name "Bot"
git config user.email "bot@gorules.io"
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: 'Install dependencies'
run: pip install --upgrade bump2version
- name: Bumpversion
run: bumpversion ${{ github.event.inputs.version }} --allow-dirty --tag-name "uniffi-v{new_version}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.PAT}}
-1
View File
@@ -110,7 +110,6 @@ jobs:
run: |
cargo run \
--bin uniffi-bindgen \
--features "uniffi/cli" \
-- generate \
--library build/generated/main/resources/linux-x86-64/libzen_uniffi.so \
--language kotlin \
+7
View File
@@ -0,0 +1,7 @@
[bumpversion]
current_version = 0.1.0
commit = True
tag = True
message = chore(release): publish uniffi
[bumpversion:file:Cargo.toml]
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "zen-uniffi"
version = "0.39.0"
version = "0.1.0"
edition = "2021"
license = "MIT"
publish = false
@@ -13,7 +13,7 @@ name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"
[dependencies]
uniffi = { version = "0.29.0", features = ["tokio"] }
uniffi = { version = "0.29.0", features = ["tokio", "cli"] }
serde_json = { workspace = true }
zen-engine = { path = "../../core/engine" }
zen-expression = { path = "../../core/expression" }
+16 -1
View File
@@ -1,7 +1,15 @@
import org.tomlj.Toml
import java.util.*
group = "io.gorules"
version = "0.1.0"
version = loadCargoVersion()
buildscript {
dependencies {
classpath("org.tomlj:tomlj:1.1.1")
}
}
plugins {
kotlin("jvm") version "2.1.0"
@@ -95,4 +103,11 @@ nmcp {
password.set(remotePassword.get())
}
}
}
fun loadCargoVersion(): String {
val cargoFile = file("${projectDir}/Cargo.toml")
val result = Toml.parse(cargoFile.toPath())
return result.getTable("package")?.getString("version")
?: throw GradleException("Version not found in Cargo.toml")
}