mirror of
https://github.com/gorules/zen.git
synced 2026-10-07 08:02:21 +00:00
add pipelines for release
This commit is contained in:
@@ -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}}
|
||||
@@ -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 \
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
[bumpversion]
|
||||
current_version = 0.1.0
|
||||
commit = True
|
||||
tag = True
|
||||
message = chore(release): publish uniffi
|
||||
|
||||
[bumpversion:file:Cargo.toml]
|
||||
@@ -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" }
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
Reference in New Issue
Block a user