-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit; warning rename in progress
We're still wrapping up naming and finalizing structures before 1.0 release
- Loading branch information
0 parents
commit 2d5ef89
Showing
67 changed files
with
10,166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Bump Version | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: New semver release version. | ||
|
||
jobs: | ||
bump: | ||
uses: IronCoreLabs/workflows/.github/workflows/bump-version.yaml@bump-version-v1 | ||
with: | ||
version: ${{ inputs.version }} | ||
release_mode: prerelease | ||
release_prereleases: false | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Rust CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: null | ||
workflow_dispatch: null | ||
schedule: | ||
- cron: 0 14 * * 1 | ||
|
||
jobs: | ||
rust-ci: | ||
uses: IronCoreLabs/workflows/.github/workflows/rust-ci.yaml@rust-ci-v1 | ||
with: | ||
run_clippy: true | ||
minimum_coverage: "50" | ||
cargo_command_test_args: "--lib" # Doesn't generate or test Python/Kotlin | ||
test_matrix_rust_version: '[]' | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Rust Daily | ||
on: | ||
schedule: | ||
- cron: 0 14 * * 1-5 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
rust-daily: | ||
uses: IronCoreLabs/workflows/.github/workflows/rust-daily.yaml@rust-daily-v0 | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Python/Kotlin CI | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
generate-cdylibs: | ||
uses: IronCoreLabs/workflows/.github/workflows/rust-artifact.yaml@rust-artifact-v0 | ||
with: | ||
# This should stay in sync with the `runs-on` from the other jobs in this file | ||
os_matrix: '["buildjet-2vcpu-ubuntu-2204"]' # TODO: add back: "buildjet-4vcpu-ubuntu-2204-arm", "macos-12", ["self-hosted", "macOS", "ARM64"]]' | ||
build_profile: "release" | ||
secrets: inherit | ||
|
||
kotlin-test: | ||
needs: generate-cdylibs | ||
runs-on: ${{ matrix.runs-on }} | ||
strategy: | ||
matrix: | ||
# This should stay in sync with the `os_matrix` above | ||
runs-on: ["buildjet-2vcpu-ubuntu-2204"] # TODO: add back: "buildjet-4vcpu-ubuntu-2204-arm", "macos-12", ["self-hosted", "macOS", "ARM64"] ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ join(matrix.runs-on) }}- | ||
path: ${{ github.workspace }}/core/kotlin/src/main/resources/ | ||
- if: startsWith(matrix.runs-on, 'buildjet') | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-provider: buildjet | ||
- if: startsWith(matrix.runs-on, 'macos') | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-provider: github | ||
- name: Generate Kotlin files | ||
run: cargo run --bin uniffi-bindgen generate --library resources/libcloaked_ai.* --language kotlin --out-dir kotlin | ||
working-directory: core/kotlin/src/main | ||
# - name: Run Kotlin tests TODO add back | ||
# run: ./gradlew test | ||
# working-directory: core/kotlin | ||
|
||
python-test: | ||
needs: generate-cdylibs | ||
runs-on: ${{ matrix.runs-on }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# This should stay in sync with the `os_matrix` above and the `runs-on` from the other jobs in this file | ||
runs-on: ["buildjet-2vcpu-ubuntu-2204"] # TODO: add back: "buildjet-4vcpu-ubuntu-2204-arm", "macos-12", ["self-hosted", "macOS", "ARM64"] ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ join(matrix.runs-on) }}- | ||
path: ${{ github.workspace }}/core/python/cloaked-ai/cloaked_ai | ||
- if: startsWith(matrix.runs-on, 'buildjet') | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-provider: buildjet | ||
- if: startsWith(matrix.runs-on, 'macos') | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-provider: github | ||
- name: Generate Python files | ||
run: cargo run --bin uniffi-bindgen generate --library libcloaked_ai.* --language python --out-dir . | ||
working-directory: core/python/cloaked-ai/cloaked_ai | ||
- name: Install hatch | ||
if: matrix.runs-on == 'buildjet-4vcpu-ubuntu-2204-arm' | ||
# The buildjet arm machine has a permissions error if we don't use sudo | ||
run: sudo pipx install hatch | ||
- name: Install hatch | ||
if: matrix.runs-on != 'buildjet-4vcpu-ubuntu-2204-arm' | ||
run: pipx install hatch | ||
- name: Install Python test matrix | ||
uses: actions/setup-python@v4 | ||
if: endsWith(matrix.runs-on, 'arm') != true && contains(matrix.runs-on, 'self-hosted') != true | ||
with: | ||
# there are no builds for arm linux at all, so we'll make do with the system ones | ||
python-version: | | ||
3.7 | ||
3.8 | ||
3.9 | ||
3.10 | ||
3.11 | ||
- name: Install Python test matrix (self-hosted) | ||
if: contains(matrix.runs-on, 'self-hosted') | ||
uses: actions/setup-python@v4 | ||
with: | ||
# arm mac builds don't exist for pre-3.10 | ||
python-version: | | ||
3.10 | ||
3.11 | ||
# - name: Run Python tests TODO add back | ||
# run: hatch run test:test | ||
# working-directory: core/python/cloaked-ai/cloaked_ai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Python/Kotlin Release | ||
on: | ||
# https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#release | ||
# The Bump Version workflow will make a Github release if it isn't a prerelease version | ||
release: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
|
||
jobs: | ||
generate-cdylibs: | ||
uses: IronCoreLabs/workflows/.github/workflows/rust-artifact.yaml@rust-artifact-v0 | ||
with: | ||
os_matrix: '["buildjet-2vcpu-ubuntu-2204", "buildjet-4vcpu-ubuntu-2204-arm", "macos-12", ["self-hosted", "macOS", "ARM64"]]' | ||
build_profile: "release" | ||
secrets: inherit | ||
|
||
kotlin-release: | ||
needs: generate-cdylibs | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
path: ${{ github.workspace }}/core/kotlin/src/main/resources/ | ||
- name: Rename directories | ||
run: | | ||
mv buildjet-2vcpu-ubuntu-2204- linux-x86-64 | ||
mv buildjet-4vcpu-ubuntu-2204-arm- linux-arm | ||
mv macos-12- darwin-x86-64 | ||
mv self-hosted,macOS,ARM64- darwin-aarch64 | ||
working-directory: core/kotlin/src/main/resources/ | ||
- name: Decrypt GPG key and gradle.properties | ||
uses: IronCoreLabs/ironhide-actions/decrypt@v3 | ||
with: | ||
keys: ${{ secrets.IRONHIDE_KEYS }} | ||
input: .github/9FA43559.asc.iron .github/gradle.properties.iron | ||
- name: Move gradle properties and GPG key | ||
run: | | ||
mv .github/gradle.properties core/kotlin/gradle.properties | ||
- name: Import GPG key | ||
run: | | ||
gpg --batch --import .github/9FA43559.asc | ||
- name: Export GPG signing key | ||
run: gpg --export-secret-keys > /tmp/9FA43559.asc | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-provider: buildjet | ||
- name: Generate Kotlin files | ||
run: cargo run --bin uniffi-bindgen generate --library resources/linux-x86-64/libcloaked_ai.so --language kotlin --out-dir kotlin | ||
working-directory: core/kotlin/src/main | ||
- name: Publish | ||
run: ./gradlew publish | ||
working-directory: core/kotlin | ||
env: | ||
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||
|
||
python-release: | ||
needs: generate-cdylibs | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
path: ${{ github.workspace }}/core/python/cloaked-ai | ||
- name: Rename directories | ||
run: | | ||
mv buildjet-2vcpu-ubuntu-2204- linux-x86-64 | ||
mv buildjet-4vcpu-ubuntu-2204-arm- linux-arm | ||
mv macos-12- darwin-x86-64 | ||
mv self-hosted,macOS,ARM64- darwin-aarch64 | ||
working-directory: core/python/cloaked-ai | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-provider: buildjet | ||
- name: Generate Python files | ||
run: cargo run --bin uniffi-bindgen generate --library ../linux-x86-64/libcloaked_ai.so --language python --out-dir . | ||
working-directory: core/python/cloaked-ai/cloaked_ai | ||
- name: Install hatch | ||
run: pipx install hatch | ||
- name: Make wheels | ||
run: | | ||
archs="darwin-aarch64 darwin-x86-64 linux-arm linux-x86-64" | ||
for arch in $archs; do | ||
mv ../$arch/* ./ | ||
CDYLIB_PLATFORM=$arch hatch build -t wheel | ||
rm libcloaked_ai.* | ||
done | ||
working-directory: core/python/cloaked-ai/cloaked_ai | ||
- name: Release to PyPi | ||
run: hatch publish --repo main --user __token__ --auth "${{ secrets.PYPI_TOKEN }}" | ||
working-directory: core/python/cloaked-ai/cloaked_ai | ||
|
||
mark-github-release: | ||
if: github.event.release != null | ||
needs: [kotlin-release, python-release] | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
- name: Mark GitHub release as not prerelease | ||
env: | ||
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }} | ||
run: gh release edit --tag "${{ github.event.release.tag_name }}" --prerelease=false "${{ github.event.release.name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
**/out/ | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
.vscode | ||
|
||
*.json | ||
.direnv | ||
|
||
!default_config/** | ||
|
||
**/proptest-regressions/ | ||
|
||
# python build files | ||
**/python/**/*.so | ||
**/python/**/*.dylib | ||
**/python/**/dist | ||
**/__pycache__ | ||
**/.coverage | ||
|
||
# python generated foreign module | ||
**/cloaked_ai.py |
Oops, something went wrong.