onde-cli 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onde_cli-0.2.0/.github/workflows/ci.yml +150 -0
- onde_cli-0.2.0/.github/workflows/release-crates.yml +120 -0
- onde_cli-0.2.0/.github/workflows/release-github.yml +191 -0
- onde_cli-0.2.0/.github/workflows/release-homebrew.yml +116 -0
- onde_cli-0.2.0/.github/workflows/release-pypi.yml +196 -0
- onde_cli-0.2.0/.gitignore +3 -0
- onde_cli-0.2.0/Cargo.lock +4350 -0
- onde_cli-0.2.0/Cargo.toml +58 -0
- onde_cli-0.2.0/LICENSE +201 -0
- onde_cli-0.2.0/PKG-INFO +169 -0
- onde_cli-0.2.0/README.md +121 -0
- onde_cli-0.2.0/assets/ondeinference-apps.png +0 -0
- onde_cli-0.2.0/build.rs +34 -0
- onde_cli-0.2.0/pypi/README.md +141 -0
- onde_cli-0.2.0/pypi/pyproject.toml +39 -0
- onde_cli-0.2.0/pyproject.toml +39 -0
- onde_cli-0.2.0/rust-toolchain.toml +2 -0
- onde_cli-0.2.0/src/app.rs +1390 -0
- onde_cli-0.2.0/src/finetune.rs +823 -0
- onde_cli-0.2.0/src/gresiq.rs +61 -0
- onde_cli-0.2.0/src/hf.rs +333 -0
- onde_cli-0.2.0/src/hf_search.rs +227 -0
- onde_cli-0.2.0/src/main.rs +49 -0
- onde_cli-0.2.0/src/token.rs +30 -0
- onde_cli-0.2.0/src/ui.rs +1493 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
CARGO_TERM_COLOR: always
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
fmt:
|
|
22
|
+
name: Format
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v6
|
|
27
|
+
|
|
28
|
+
- name: Install Rust toolchain
|
|
29
|
+
uses: dtolnay/rust-toolchain@stable
|
|
30
|
+
with:
|
|
31
|
+
components: rustfmt
|
|
32
|
+
|
|
33
|
+
- name: Check formatting
|
|
34
|
+
run: cargo fmt -- --check
|
|
35
|
+
|
|
36
|
+
clippy:
|
|
37
|
+
name: Clippy
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- name: Checkout
|
|
41
|
+
uses: actions/checkout@v6
|
|
42
|
+
|
|
43
|
+
- name: Install Rust toolchain
|
|
44
|
+
uses: dtolnay/rust-toolchain@stable
|
|
45
|
+
with:
|
|
46
|
+
components: clippy
|
|
47
|
+
|
|
48
|
+
- name: Install system dependencies
|
|
49
|
+
run: sudo apt-get install -y libclang-dev
|
|
50
|
+
|
|
51
|
+
- name: Cache cargo registry and build artifacts
|
|
52
|
+
uses: Swatinem/rust-cache@v2
|
|
53
|
+
|
|
54
|
+
- name: Lint
|
|
55
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
56
|
+
env:
|
|
57
|
+
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
|
|
58
|
+
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
|
|
59
|
+
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
|
|
60
|
+
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
|
|
61
|
+
|
|
62
|
+
test:
|
|
63
|
+
name: Test
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- name: Checkout
|
|
67
|
+
uses: actions/checkout@v6
|
|
68
|
+
|
|
69
|
+
- name: Install Rust toolchain
|
|
70
|
+
uses: dtolnay/rust-toolchain@stable
|
|
71
|
+
|
|
72
|
+
- name: Install system dependencies
|
|
73
|
+
run: sudo apt-get install -y libclang-dev
|
|
74
|
+
|
|
75
|
+
- name: Cache cargo registry and build artifacts
|
|
76
|
+
uses: Swatinem/rust-cache@v2
|
|
77
|
+
|
|
78
|
+
- name: Run tests
|
|
79
|
+
run: cargo test --locked --verbose
|
|
80
|
+
env:
|
|
81
|
+
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
|
|
82
|
+
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
|
|
83
|
+
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
|
|
84
|
+
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
|
|
85
|
+
|
|
86
|
+
check:
|
|
87
|
+
name: Cargo check
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
steps:
|
|
90
|
+
- name: Checkout
|
|
91
|
+
uses: actions/checkout@v6
|
|
92
|
+
|
|
93
|
+
- name: Install Rust toolchain
|
|
94
|
+
uses: dtolnay/rust-toolchain@stable
|
|
95
|
+
|
|
96
|
+
- name: Install system dependencies
|
|
97
|
+
run: sudo apt-get install -y libclang-dev
|
|
98
|
+
|
|
99
|
+
- name: Cache cargo registry and build artifacts
|
|
100
|
+
uses: Swatinem/rust-cache@v2
|
|
101
|
+
|
|
102
|
+
- name: Cargo check
|
|
103
|
+
run: cargo check --locked
|
|
104
|
+
env:
|
|
105
|
+
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
|
|
106
|
+
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
|
|
107
|
+
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
|
|
108
|
+
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
|
|
109
|
+
|
|
110
|
+
build:
|
|
111
|
+
name: Build (aarch64-apple-darwin)
|
|
112
|
+
runs-on: macos-latest
|
|
113
|
+
steps:
|
|
114
|
+
- name: Checkout
|
|
115
|
+
uses: actions/checkout@v6
|
|
116
|
+
|
|
117
|
+
- name: Install Rust toolchain
|
|
118
|
+
uses: dtolnay/rust-toolchain@stable
|
|
119
|
+
with:
|
|
120
|
+
targets: aarch64-apple-darwin
|
|
121
|
+
|
|
122
|
+
- name: Cache cargo registry and build artifacts
|
|
123
|
+
uses: Swatinem/rust-cache@v2
|
|
124
|
+
|
|
125
|
+
- name: Build release binary
|
|
126
|
+
run: cargo build --release --locked --target aarch64-apple-darwin
|
|
127
|
+
env:
|
|
128
|
+
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
|
|
129
|
+
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
|
|
130
|
+
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
|
|
131
|
+
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
|
|
132
|
+
|
|
133
|
+
ci:
|
|
134
|
+
name: CI status
|
|
135
|
+
runs-on: ubuntu-latest
|
|
136
|
+
needs:
|
|
137
|
+
- fmt
|
|
138
|
+
- clippy
|
|
139
|
+
- test
|
|
140
|
+
- check
|
|
141
|
+
- build
|
|
142
|
+
if: always()
|
|
143
|
+
steps:
|
|
144
|
+
- name: Verify all required jobs succeeded
|
|
145
|
+
run: |
|
|
146
|
+
test "${{ needs.fmt.result }}" = "success"
|
|
147
|
+
test "${{ needs.clippy.result }}" = "success"
|
|
148
|
+
test "${{ needs.test.result }}" = "success"
|
|
149
|
+
test "${{ needs.check.result }}" = "success"
|
|
150
|
+
test "${{ needs.build.result }}" = "success"
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: Release crates.io
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: release-crates-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
CARGO_TERM_COLOR: always
|
|
18
|
+
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
|
|
19
|
+
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
|
|
20
|
+
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
|
|
21
|
+
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
verify:
|
|
25
|
+
name: Verify release
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
outputs:
|
|
28
|
+
version: ${{ steps.package.outputs.version }}
|
|
29
|
+
tag: ${{ steps.tag.outputs.tag }}
|
|
30
|
+
steps:
|
|
31
|
+
- name: Checkout
|
|
32
|
+
uses: actions/checkout@v6
|
|
33
|
+
|
|
34
|
+
- name: Install Rust toolchain
|
|
35
|
+
uses: dtolnay/rust-toolchain@stable
|
|
36
|
+
with:
|
|
37
|
+
components: clippy, rustfmt
|
|
38
|
+
|
|
39
|
+
- name: Cache cargo registry and build artifacts
|
|
40
|
+
uses: Swatinem/rust-cache@v2
|
|
41
|
+
|
|
42
|
+
- name: Read package version
|
|
43
|
+
id: package
|
|
44
|
+
shell: bash
|
|
45
|
+
run: |
|
|
46
|
+
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1)"
|
|
47
|
+
if [ -z "$version" ]; then
|
|
48
|
+
echo "Failed to read package version from Cargo.toml" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
52
|
+
|
|
53
|
+
- name: Read git tag version
|
|
54
|
+
id: tag
|
|
55
|
+
shell: bash
|
|
56
|
+
run: |
|
|
57
|
+
ref="${GITHUB_REF_NAME}"
|
|
58
|
+
tag="${ref#v}"
|
|
59
|
+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
60
|
+
|
|
61
|
+
- name: Ensure tag matches Cargo.toml version
|
|
62
|
+
if: github.event_name == 'push'
|
|
63
|
+
shell: bash
|
|
64
|
+
run: |
|
|
65
|
+
test "${{ steps.package.outputs.version }}" = "${{ steps.tag.outputs.tag }}"
|
|
66
|
+
|
|
67
|
+
- name: Check formatting
|
|
68
|
+
run: cargo fmt --all -- --check
|
|
69
|
+
|
|
70
|
+
- name: Run clippy
|
|
71
|
+
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
72
|
+
|
|
73
|
+
- name: Run tests
|
|
74
|
+
run: cargo test --all-features --locked --verbose
|
|
75
|
+
|
|
76
|
+
- name: Run cargo check
|
|
77
|
+
run: cargo check --locked
|
|
78
|
+
|
|
79
|
+
- name: Verify package contents
|
|
80
|
+
run: cargo package --locked --allow-dirty
|
|
81
|
+
|
|
82
|
+
publish:
|
|
83
|
+
name: Publish to crates.io
|
|
84
|
+
runs-on: ubuntu-latest
|
|
85
|
+
needs: verify
|
|
86
|
+
environment:
|
|
87
|
+
name: crates-io
|
|
88
|
+
permissions:
|
|
89
|
+
contents: read
|
|
90
|
+
steps:
|
|
91
|
+
- name: Checkout
|
|
92
|
+
uses: actions/checkout@v6
|
|
93
|
+
|
|
94
|
+
- name: Install Rust toolchain
|
|
95
|
+
uses: dtolnay/rust-toolchain@stable
|
|
96
|
+
|
|
97
|
+
- name: Cache cargo registry and build artifacts
|
|
98
|
+
uses: Swatinem/rust-cache@v2
|
|
99
|
+
|
|
100
|
+
- name: Publish crate
|
|
101
|
+
env:
|
|
102
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
103
|
+
run: cargo publish --locked
|
|
104
|
+
|
|
105
|
+
github-release:
|
|
106
|
+
name: Create GitHub release
|
|
107
|
+
runs-on: ubuntu-latest
|
|
108
|
+
needs:
|
|
109
|
+
- verify
|
|
110
|
+
- publish
|
|
111
|
+
if: github.event_name == 'push'
|
|
112
|
+
permissions:
|
|
113
|
+
contents: write
|
|
114
|
+
steps:
|
|
115
|
+
- name: Create release
|
|
116
|
+
uses: softprops/action-gh-release@v2
|
|
117
|
+
with:
|
|
118
|
+
tag_name: v${{ needs.verify.outputs.version }}
|
|
119
|
+
generate_release_notes: true
|
|
120
|
+
name: onde-cli v${{ needs.verify.outputs.version }}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
name: GitHub Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
tag:
|
|
10
|
+
description: "Release tag (e.g. v0.1.1)"
|
|
11
|
+
required: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
actions: write
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
PROJECT_NAME: onde
|
|
19
|
+
CARGO_TERM_COLOR: always
|
|
20
|
+
ONDE_APP_ID: ${{ secrets.ONDE_APP_ID }}
|
|
21
|
+
ONDE_APP_SECRET: ${{ secrets.ONDE_APP_SECRET }}
|
|
22
|
+
GRESIQ_API_KEY: ${{ secrets.GRESIQ_API_KEY }}
|
|
23
|
+
GRESIQ_API_SECRET: ${{ secrets.GRESIQ_API_SECRET }}
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build:
|
|
27
|
+
name: Build binary (${{ matrix.name }})
|
|
28
|
+
runs-on: ${{ matrix.runner }}
|
|
29
|
+
|
|
30
|
+
strategy:
|
|
31
|
+
fail-fast: false
|
|
32
|
+
matrix:
|
|
33
|
+
include:
|
|
34
|
+
- name: linux-amd64
|
|
35
|
+
runner: ubuntu-latest
|
|
36
|
+
target: x86_64-unknown-linux-gnu
|
|
37
|
+
- name: linux-arm64
|
|
38
|
+
runner: ubuntu-24.04-arm
|
|
39
|
+
target: aarch64-unknown-linux-gnu
|
|
40
|
+
- name: win-amd64
|
|
41
|
+
runner: windows-latest
|
|
42
|
+
target: x86_64-pc-windows-msvc
|
|
43
|
+
- name: win-arm64
|
|
44
|
+
runner: windows-latest
|
|
45
|
+
target: aarch64-pc-windows-msvc
|
|
46
|
+
- name: macos-amd64
|
|
47
|
+
runner: macos-15-intel
|
|
48
|
+
target: x86_64-apple-darwin
|
|
49
|
+
- name: macos-arm64
|
|
50
|
+
runner: macos-latest
|
|
51
|
+
target: aarch64-apple-darwin
|
|
52
|
+
|
|
53
|
+
steps:
|
|
54
|
+
- name: Checkout
|
|
55
|
+
uses: actions/checkout@v6
|
|
56
|
+
with:
|
|
57
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
58
|
+
|
|
59
|
+
- name: Set the release version
|
|
60
|
+
shell: bash
|
|
61
|
+
run: |
|
|
62
|
+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
|
|
63
|
+
release_version="${GITHUB_REF_NAME#v}"
|
|
64
|
+
else
|
|
65
|
+
release_version="${{ github.event.inputs.tag }}"
|
|
66
|
+
release_version="${release_version#v}"
|
|
67
|
+
fi
|
|
68
|
+
echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV"
|
|
69
|
+
|
|
70
|
+
- name: Read Rust toolchain
|
|
71
|
+
shell: bash
|
|
72
|
+
run: |
|
|
73
|
+
rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
|
|
74
|
+
if [ -z "$rust_toolchain" ]; then
|
|
75
|
+
echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
|
|
79
|
+
|
|
80
|
+
- name: Install Rust toolchain
|
|
81
|
+
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
|
|
82
|
+
with:
|
|
83
|
+
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
84
|
+
targets: ${{ matrix.target }}
|
|
85
|
+
|
|
86
|
+
- name: Setup Rust cache
|
|
87
|
+
uses: Swatinem/rust-cache@v2
|
|
88
|
+
with:
|
|
89
|
+
key: github-${{ matrix.target }}
|
|
90
|
+
|
|
91
|
+
- name: Build binary
|
|
92
|
+
shell: bash
|
|
93
|
+
run: cargo build --locked --release --target ${{ matrix.target }}
|
|
94
|
+
|
|
95
|
+
- name: Package binary
|
|
96
|
+
shell: bash
|
|
97
|
+
run: |
|
|
98
|
+
BIN_SUFFIX=""
|
|
99
|
+
if [[ "${{ matrix.runner }}" == "windows-latest" ]]; then
|
|
100
|
+
BIN_SUFFIX=".exe"
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
BIN_OUTPUT="target/${{ matrix.target }}/release/${PROJECT_NAME}${BIN_SUFFIX}"
|
|
104
|
+
BIN_RELEASE="${PROJECT_NAME}-${{ matrix.name }}${BIN_SUFFIX}"
|
|
105
|
+
|
|
106
|
+
mkdir -p ./release
|
|
107
|
+
mv "${BIN_OUTPUT}" "./release/${BIN_RELEASE}"
|
|
108
|
+
|
|
109
|
+
- name: Package macOS tarball for Homebrew
|
|
110
|
+
if: contains(matrix.target, 'apple-darwin')
|
|
111
|
+
shell: bash
|
|
112
|
+
run: |
|
|
113
|
+
ARCHIVE_NAME="${PROJECT_NAME}-${{ matrix.name }}.tar.gz"
|
|
114
|
+
|
|
115
|
+
mkdir -p staging-brew
|
|
116
|
+
cp "./release/${PROJECT_NAME}-${{ matrix.name }}" "staging-brew/${PROJECT_NAME}"
|
|
117
|
+
strip "staging-brew/${PROJECT_NAME}"
|
|
118
|
+
|
|
119
|
+
tar -C staging-brew -czf "${ARCHIVE_NAME}" "${PROJECT_NAME}"
|
|
120
|
+
|
|
121
|
+
shasum -a 256 "${ARCHIVE_NAME}" | awk '{print $1}' > "${ARCHIVE_NAME}.sha256"
|
|
122
|
+
|
|
123
|
+
echo "Archive: ${ARCHIVE_NAME}"
|
|
124
|
+
echo "SHA256: $(cat "${ARCHIVE_NAME}.sha256")"
|
|
125
|
+
|
|
126
|
+
- name: Upload binary artifact
|
|
127
|
+
uses: actions/upload-artifact@v4
|
|
128
|
+
with:
|
|
129
|
+
name: binary-${{ matrix.name }}
|
|
130
|
+
path: release/*
|
|
131
|
+
|
|
132
|
+
- name: Upload macOS Homebrew artifacts
|
|
133
|
+
if: contains(matrix.target, 'apple-darwin')
|
|
134
|
+
uses: actions/upload-artifact@v4
|
|
135
|
+
with:
|
|
136
|
+
name: homebrew-${{ matrix.name }}
|
|
137
|
+
path: |
|
|
138
|
+
${{ env.PROJECT_NAME }}-${{ matrix.name }}.tar.gz
|
|
139
|
+
${{ env.PROJECT_NAME }}-${{ matrix.name }}.tar.gz.sha256
|
|
140
|
+
|
|
141
|
+
release:
|
|
142
|
+
name: Create GitHub Release
|
|
143
|
+
needs: build
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
if: github.ref_type == 'tag' || github.event_name == 'workflow_dispatch'
|
|
146
|
+
|
|
147
|
+
steps:
|
|
148
|
+
- name: Resolve tag
|
|
149
|
+
id: tag
|
|
150
|
+
shell: bash
|
|
151
|
+
run: |
|
|
152
|
+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
153
|
+
echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
|
|
154
|
+
else
|
|
155
|
+
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
- name: Download binary artifacts
|
|
159
|
+
uses: actions/download-artifact@v4
|
|
160
|
+
with:
|
|
161
|
+
pattern: "binary-*"
|
|
162
|
+
path: release
|
|
163
|
+
merge-multiple: true
|
|
164
|
+
|
|
165
|
+
- name: Download Homebrew artifacts
|
|
166
|
+
uses: actions/download-artifact@v4
|
|
167
|
+
with:
|
|
168
|
+
pattern: "homebrew-*"
|
|
169
|
+
path: release
|
|
170
|
+
merge-multiple: true
|
|
171
|
+
|
|
172
|
+
- name: Release
|
|
173
|
+
uses: softprops/action-gh-release@v2
|
|
174
|
+
with:
|
|
175
|
+
tag_name: ${{ steps.tag.outputs.tag }}
|
|
176
|
+
files: release/*
|
|
177
|
+
|
|
178
|
+
- name: Trigger Homebrew release
|
|
179
|
+
uses: actions/github-script@v7
|
|
180
|
+
with:
|
|
181
|
+
script: |
|
|
182
|
+
await github.rest.actions.createWorkflowDispatch({
|
|
183
|
+
owner: context.repo.owner,
|
|
184
|
+
repo: context.repo.repo,
|
|
185
|
+
workflow_id: 'release-homebrew.yml',
|
|
186
|
+
ref: 'main',
|
|
187
|
+
inputs: {
|
|
188
|
+
tag: '${{ steps.tag.outputs.tag }}'
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
console.log('Dispatched release-homebrew.yml for tag ${{ steps.tag.outputs.tag }}')
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
name: Homebrew CLI Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
tag:
|
|
7
|
+
description: "Release tag (e.g. v0.1.1)"
|
|
8
|
+
required: true
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
REPO: ondeinference/onde-cli
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
update-homebrew-tap:
|
|
18
|
+
name: Update Homebrew tap
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Resolve tag and version
|
|
23
|
+
id: release
|
|
24
|
+
shell: bash
|
|
25
|
+
run: |
|
|
26
|
+
TAG="${{ github.event.inputs.tag }}"
|
|
27
|
+
VERSION="${TAG#v}"
|
|
28
|
+
|
|
29
|
+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
30
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
31
|
+
|
|
32
|
+
- name: Read SHA256 checksums from release
|
|
33
|
+
id: sha
|
|
34
|
+
env:
|
|
35
|
+
GH_TOKEN: ${{ github.token }}
|
|
36
|
+
shell: bash
|
|
37
|
+
run: |
|
|
38
|
+
mkdir -p artifacts
|
|
39
|
+
|
|
40
|
+
gh release download "${{ steps.release.outputs.tag }}" \
|
|
41
|
+
--repo "${{ env.REPO }}" \
|
|
42
|
+
--pattern "onde-macos-*.tar.gz.sha256" \
|
|
43
|
+
--dir artifacts/
|
|
44
|
+
|
|
45
|
+
ARM64_SHA=$(cat artifacts/onde-macos-arm64.tar.gz.sha256)
|
|
46
|
+
AMD64_SHA=$(cat artifacts/onde-macos-amd64.tar.gz.sha256)
|
|
47
|
+
|
|
48
|
+
echo "arm64=${ARM64_SHA}" >> "$GITHUB_OUTPUT"
|
|
49
|
+
echo "amd64=${AMD64_SHA}" >> "$GITHUB_OUTPUT"
|
|
50
|
+
|
|
51
|
+
echo "ARM64 SHA256: ${ARM64_SHA}"
|
|
52
|
+
echo "AMD64 SHA256: ${AMD64_SHA}"
|
|
53
|
+
|
|
54
|
+
- name: Checkout Homebrew tap
|
|
55
|
+
uses: actions/checkout@v6
|
|
56
|
+
with:
|
|
57
|
+
repository: ondeinference/homebrew-tap
|
|
58
|
+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
|
59
|
+
path: homebrew-tap
|
|
60
|
+
|
|
61
|
+
- name: Generate formula
|
|
62
|
+
shell: bash
|
|
63
|
+
run: |
|
|
64
|
+
VERSION="${{ steps.release.outputs.version }}"
|
|
65
|
+
TAG="${{ steps.release.outputs.tag }}"
|
|
66
|
+
ARM64_SHA="${{ steps.sha.outputs.arm64 }}"
|
|
67
|
+
AMD64_SHA="${{ steps.sha.outputs.amd64 }}"
|
|
68
|
+
|
|
69
|
+
mkdir -p homebrew-tap/Formula
|
|
70
|
+
|
|
71
|
+
cat > homebrew-tap/Formula/onde.rb <<FORMULA
|
|
72
|
+
# frozen_string_literal: true
|
|
73
|
+
|
|
74
|
+
# Homebrew formula for the Onde Inference CLI (\`onde\` binary).
|
|
75
|
+
class Onde < Formula
|
|
76
|
+
desc 'Command-line interface for Onde Inference'
|
|
77
|
+
homepage 'https://ondeinference.com'
|
|
78
|
+
version '${VERSION}'
|
|
79
|
+
license 'MIT OR Apache-2.0'
|
|
80
|
+
|
|
81
|
+
on_macos do
|
|
82
|
+
on_arm do
|
|
83
|
+
url 'https://github.com/${REPO}/releases/download/${TAG}/onde-macos-arm64.tar.gz'
|
|
84
|
+
sha256 '${ARM64_SHA}'
|
|
85
|
+
end
|
|
86
|
+
on_intel do
|
|
87
|
+
url 'https://github.com/${REPO}/releases/download/${TAG}/onde-macos-amd64.tar.gz'
|
|
88
|
+
sha256 '${AMD64_SHA}'
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def install
|
|
93
|
+
bin.install 'onde'
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
test do
|
|
97
|
+
assert_match version.to_s, shell_output("#{bin}/onde --version", 1)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
FORMULA
|
|
101
|
+
|
|
102
|
+
echo "Generated formula:"
|
|
103
|
+
cat homebrew-tap/Formula/onde.rb
|
|
104
|
+
|
|
105
|
+
- name: Commit and push
|
|
106
|
+
shell: bash
|
|
107
|
+
run: |
|
|
108
|
+
VERSION="${{ steps.release.outputs.version }}"
|
|
109
|
+
|
|
110
|
+
cd homebrew-tap
|
|
111
|
+
git config user.name "github-actions[bot]"
|
|
112
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
113
|
+
git add Formula/onde.rb
|
|
114
|
+
git diff --cached --quiet && echo "No changes to commit" && exit 0
|
|
115
|
+
git commit -m "Update onde to ${VERSION}"
|
|
116
|
+
git push
|