Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# os: [ubuntu-latest, windows-latest]
# fail-fast: false
# steps:
# - uses: actions/checkout@v4
# - uses: actions/checkout@v6
# - uses: moonrepo/setup-rust@v1
# with:
# cache: false
Expand All @@ -35,7 +35,7 @@ jobs:
# os: [ubuntu-latest, windows-latest]
# fail-fast: false
# steps:
# - uses: actions/checkout@v4
# - uses: actions/checkout@v6
# - uses: moonrepo/setup-rust@v1
# with:
# cache: false
Expand All @@ -49,7 +49,7 @@ jobs:
# os: [ubuntu-latest, macos-latest, windows-latest]
# fail-fast: false
# steps:
# - uses: actions/checkout@v4
# - uses: actions/checkout@v6
# - uses: moonrepo/setup-rust@v1
# with:
# bins: cargo-nextest
Expand All @@ -66,7 +66,7 @@ jobs:
job-total: ${{ steps.plan.outputs.job-total }}
jobs-array: ${{ steps.plan.outputs.jobs-array }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: moonrepo/setup-toolchain@v0
Expand All @@ -85,7 +85,7 @@ jobs:
job: ${{ fromJson(needs.plan.outputs.jobs-array) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: moonrepo/setup-toolchain@v0
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Release

permissions:
# Releases
contents: write
# Packages
packages: write
attestations: write
id-token: write

on:
push:
Expand All @@ -14,12 +19,16 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: moonrepo/setup-rust@v1
with:
cache: false
- id: build
uses: moonrepo/build-wasm-plugin@v0
with:
publish: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: ncipollo/release-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ projects:
# Tools
bun-tool: tools/bun
deno-tool: tools/deno
example-tool: tools/example
go-tool: tools/go
moon-tool: tools/moon
node-tool: tools/node
Expand Down
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ for (let pkg of packages) {
annosPath,
"--artifact-type",
"application/wasm",
`ghcr.io/moonrepo/${pkg.name}:${pkg.version}`,
`ghcr.io/moonrepo/${pkg.name}:${pkg.version},latest`,
`${wasmFile}:application/wasm`,
];

Expand Down
7 changes: 7 additions & 0 deletions tools/example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## Unreleased

#### 🎉 Release

- Initial release!
28 changes: 28 additions & 0 deletions tools/example/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "example_tool"
version = "0.0.0"
edition = "2024"
description = "Example tool."
authors = ["Miles Johnson"]
license = "MIT"
repository = "https://github.com/moonrepo/plugins"
documentation = "https://github.com/moonrepo/plugins/tree/master/tools/example"
publish = false

[package.metadata.release]
pre-release-replacements = [
{ file = "./CHANGELOG.md", search = "Unreleased", replace = "{{version}}" },
]

[lib]
crate-type = ["cdylib"]

[dependencies]
tool_common = { path = "../../crates/tool-common" }
extism-pdk = { workspace = true }
proto_pdk = { workspace = true }
serde = { workspace = true }

[features]
default = ["wasm"]
wasm = []
3 changes: 3 additions & 0 deletions tools/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# example plugin

An example plugin for testing our systems.
5 changes: 5 additions & 0 deletions tools/example/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[cfg(feature = "wasm")]
mod proto;

#[cfg(feature = "wasm")]
pub use proto::*;
15 changes: 15 additions & 0 deletions tools/example/src/proto.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use extism_pdk::*;
use proto_pdk::*;
use tool_common::enable_tracing;

#[plugin_fn]
pub fn register_tool(Json(_): Json<RegisterToolInput>) -> FnResult<Json<RegisterToolOutput>> {
enable_tracing();

Ok(Json(RegisterToolOutput {
name: "Example".into(),
type_of: PluginType::CommandLine,
plugin_version: Version::parse(env!("CARGO_PKG_VERSION")).ok(),
..RegisterToolOutput::default()
}))
}
Loading