Skip to content

Commit

Permalink
Added workflows (#21)
Browse files Browse the repository at this point in the history
Migrated to a workspace and added caching
  • Loading branch information
ivanleomk authored Jul 8, 2024
1 parent f74eed6 commit e26c587
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 80 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
release:
types: [published]

jobs:
publish:
name: Publish to crates.io

runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.created

environment: crates.io

steps:
- uses: actions/checkout@v3
- uses: swatinem/rust-cache@v2

- name: Publish
# https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials
run: >
cargo workspaces publish
--verbose
--allow-branch *
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}
19 changes: 9 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Cargo Build & Test

on:
pull_request:
push:
branches:
- main

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,17 +17,15 @@ jobs:
matrix:
toolchain:
- stable
# - beta
# - nightly
- beta
- nightly
crate:
# - instruct-macros
- instruct-macros
- instructor
steps:
- uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
path: ${{ matrix.crate }}
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cd ${{ matrix.crate }} && cargo build --verbose

Expand All @@ -35,18 +36,16 @@ jobs:
strategy:
matrix:
toolchain:
# - stable
# - beta
- stable
- beta
- nightly
crate:
# - instruct-macros
- instruct-macros
- instructor
steps:
- uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
path: ${{ matrix.crate }}
- name: Install cargo-nextest
run: cargo install cargo-nextest --locked
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[workspace]
members = ["instruct-macros-types", "instruct-macros", "instructor"]
12 changes: 0 additions & 12 deletions docs/examples/getting-started/Cargo.toml

This file was deleted.

55 changes: 0 additions & 55 deletions docs/examples/getting-started/src/main.rs

This file was deleted.

2 changes: 1 addition & 1 deletion instruct-macros-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "instruct-macros-types"
version = "0.1.2"
version = "0.1.6"
edition = "2021"
authors = ["Ivan Leo <[email protected]>"]
description = "Instructor Macro Types are a collection of simple types that we export to work with the instruct-macros crate"
Expand Down
2 changes: 1 addition & 1 deletion instruct-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "instruct-macros"
version = "0.1.1"
version = "0.1.6"
edition = "2018"
authors = ["Ivan Leo <[email protected]>"]
description = "instruct-macros are a collection of simple macros that we're using in Instructor-AI to generate json schema from Serde Objects"
Expand Down
2 changes: 1 addition & 1 deletion instructor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "instructor-ai"
version = "0.1.0"
version = "0.1.6"
edition = "2021"
authors = ["Ivan Leo <[email protected]>"]
description = "instructor-ai is a simple crate that allows for users to do validated structured outputs"
Expand Down

0 comments on commit e26c587

Please sign in to comment.