Skip to content

Commit 9260865

Browse files
authored
Merge pull request #1 from canopy-network/main
get current
2 parents 99b2991 + ab94aa3 commit 9260865

83 files changed

Lines changed: 5879 additions & 1165 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.docker
22
cmd/tps/data
3+
# Python virtual environments
4+
**/.venv
5+
**/__pycache__
6+
**/*.pyc
7+
**/node_modules
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release C# Plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the plugin release (e.g. plugin-csharp-v1.0.0)"
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Build and Release C# Plugin
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: "8.0.x"
26+
27+
- name: Restore dependencies
28+
working-directory: plugin/csharp
29+
run: dotnet restore
30+
31+
- name: Build and publish
32+
working-directory: plugin/csharp
33+
run: |
34+
mkdir -p release
35+
# Linux glibc x64 (Ubuntu, Debian, etc.)
36+
dotnet publish CanopyPlugin.csproj -c Release -r linux-x64 --self-contained true -o release/linux-glibc-x64
37+
# Linux glibc ARM64
38+
dotnet publish CanopyPlugin.csproj -c Release -r linux-arm64 --self-contained true -o release/linux-glibc-arm64
39+
# Linux musl x64 (Alpine Docker)
40+
dotnet publish CanopyPlugin.csproj -c Release -r linux-musl-x64 --self-contained true -o release/linux-musl-x64
41+
# Linux musl ARM64 (Alpine Docker)
42+
dotnet publish CanopyPlugin.csproj -c Release -r linux-musl-arm64 --self-contained true -o release/linux-musl-arm64
43+
44+
- name: Create tarballs
45+
working-directory: plugin/csharp
46+
run: |
47+
cd release
48+
# glibc versions (standard Linux)
49+
tar -czf csharp-plugin-linux-x64.tar.gz -C linux-glibc-x64 .
50+
tar -czf csharp-plugin-linux-arm64.tar.gz -C linux-glibc-arm64 .
51+
# musl versions (Alpine Docker)
52+
tar -czf csharp-plugin-linux-musl-x64.tar.gz -C linux-musl-x64 .
53+
tar -czf csharp-plugin-linux-musl-arm64.tar.gz -C linux-musl-arm64 .
54+
55+
- name: Create GitHub release
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
tag_name: ${{ github.event.inputs.tag }}
59+
name: "C# Plugin ${{ github.event.inputs.tag }}"
60+
body: |
61+
C# Plugin Release ${{ github.event.inputs.tag }}
62+
63+
## Installation
64+
1. Extract the appropriate tarball to `plugin/csharp/bin/`
65+
2. The plugin is self-contained (no .NET runtime required)
66+
67+
## Assets
68+
### Standard Linux (glibc) - Ubuntu, Debian, RHEL, etc.
69+
- `csharp-plugin-linux-x64.tar.gz` - Linux x86_64
70+
- `csharp-plugin-linux-arm64.tar.gz` - Linux ARM64
71+
72+
### Alpine Linux (musl) - Docker containers
73+
- `csharp-plugin-linux-musl-x64.tar.gz` - Alpine x86_64
74+
- `csharp-plugin-linux-musl-arm64.tar.gz` - Alpine ARM64
75+
files: |
76+
plugin/csharp/release/csharp-plugin-linux-x64.tar.gz
77+
plugin/csharp/release/csharp-plugin-linux-arm64.tar.gz
78+
plugin/csharp/release/csharp-plugin-linux-musl-x64.tar.gz
79+
plugin/csharp/release/csharp-plugin-linux-musl-arm64.tar.gz
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release Go Plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the plugin release (e.g. plugin-go-v1.0.0)"
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Build and Release Go Plugin
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: "1.24"
26+
27+
- name: Build binaries
28+
working-directory: plugin/go
29+
run: |
30+
mkdir -p dist
31+
# Linux AMD64
32+
GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -a -o dist/go-plugin .
33+
tar -czf dist/go-plugin-linux-amd64.tar.gz -C dist go-plugin
34+
rm dist/go-plugin
35+
# Linux ARM64
36+
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -o dist/go-plugin .
37+
tar -czf dist/go-plugin-linux-arm64.tar.gz -C dist go-plugin
38+
rm dist/go-plugin
39+
40+
- name: Create GitHub release
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
tag_name: ${{ github.event.inputs.tag }}
44+
name: "Go Plugin ${{ github.event.inputs.tag }}"
45+
body: |
46+
Go Plugin Release ${{ github.event.inputs.tag }}
47+
48+
## Assets
49+
- `go-plugin-linux-amd64.tar.gz` - Linux x86_64
50+
- `go-plugin-linux-arm64.tar.gz` - Linux ARM64
51+
files: |
52+
plugin/go/dist/go-plugin-linux-amd64.tar.gz
53+
plugin/go/dist/go-plugin-linux-arm64.tar.gz
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release Kotlin Plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the plugin release (e.g. plugin-kotlin-v1.0.0)"
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Build and Release Kotlin Plugin
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: "21"
26+
distribution: "temurin"
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@v3
30+
31+
- name: Build fat JAR
32+
working-directory: plugin/kotlin
33+
run: ./gradlew fatJar --no-daemon
34+
35+
- name: Prepare release artifacts
36+
working-directory: plugin/kotlin
37+
run: |
38+
mkdir -p release
39+
cp build/libs/canopy-plugin-kotlin-*-all.jar release/kotlin-plugin.jar
40+
cd release && tar -czf kotlin-plugin.tar.gz kotlin-plugin.jar
41+
42+
- name: Create GitHub release
43+
uses: softprops/action-gh-release@v2
44+
with:
45+
tag_name: ${{ github.event.inputs.tag }}
46+
name: "Kotlin Plugin ${{ github.event.inputs.tag }}"
47+
body: |
48+
Kotlin Plugin Release ${{ github.event.inputs.tag }}
49+
50+
## Requirements
51+
- Java Runtime Environment (JRE) 21 or later
52+
53+
## Installation
54+
1. Download `kotlin-plugin.tar.gz` to `plugin/kotlin/`
55+
2. The plugin will auto-extract on first start
56+
57+
## Assets
58+
- `kotlin-plugin.tar.gz` - Fat JAR with all dependencies included
59+
files: |
60+
plugin/kotlin/release/kotlin-plugin.tar.gz
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release Python Plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the plugin release (e.g. plugin-python-v1.0.0)"
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Build and Release Python Plugin
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Create distribution tarball
28+
working-directory: plugin/python
29+
run: |
30+
mkdir -p release
31+
# Create tarball with source code (venv is created on first run by pluginctl.sh)
32+
# Note: pluginctl.sh is NOT included - it's copied separately by Dockerfile
33+
# and we don't want old releases to overwrite newer pluginctl.sh versions
34+
tar --exclude='*.pyc' \
35+
--exclude='__pycache__' \
36+
-czf release/python-plugin.tar.gz \
37+
main.py \
38+
contract/ \
39+
pyproject.toml \
40+
Makefile
41+
42+
- name: Create GitHub release
43+
uses: softprops/action-gh-release@v2
44+
with:
45+
tag_name: ${{ github.event.inputs.tag }}
46+
name: "Python Plugin ${{ github.event.inputs.tag }}"
47+
body: |
48+
Python Plugin Release ${{ github.event.inputs.tag }}
49+
50+
## Requirements
51+
- Python 3.9 or later
52+
53+
## Installation
54+
1. Extract `python-plugin.tar.gz` to `plugin/python/`
55+
2. The plugin will create a virtual environment on first run
56+
57+
## Assets
58+
- `python-plugin.tar.gz` - Source code with pyproject.toml
59+
files: |
60+
plugin/python/release/python-plugin.tar.gz
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release TypeScript Plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the plugin release (e.g. plugin-typescript-v1.0.0)"
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Build and Release TypeScript Plugin
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "20"
26+
27+
- name: Install dependencies
28+
working-directory: plugin/typescript
29+
run: npm ci
30+
31+
- name: Build plugin
32+
working-directory: plugin/typescript
33+
run: npm run build:all
34+
35+
- name: Install production dependencies only
36+
working-directory: plugin/typescript
37+
run: |
38+
rm -rf node_modules
39+
npm ci --production
40+
41+
- name: Create distribution tarball
42+
working-directory: plugin/typescript
43+
run: |
44+
mkdir -p release
45+
# Create tarball with dist/, node_modules, package.json (for "type": "module")
46+
# Note: pluginctl.sh is NOT included - it's copied separately by Dockerfile
47+
# and we don't want old releases to overwrite newer pluginctl.sh versions
48+
tar -czf release/typescript-plugin.tar.gz dist/ node_modules/ package.json
49+
50+
- name: Create GitHub release
51+
uses: softprops/action-gh-release@v2
52+
with:
53+
tag_name: ${{ github.event.inputs.tag }}
54+
name: "TypeScript Plugin ${{ github.event.inputs.tag }}"
55+
body: |
56+
TypeScript Plugin Release ${{ github.event.inputs.tag }}
57+
58+
## Installation
59+
1. Extract `typescript-plugin.tar.gz` to `plugin/typescript/`
60+
2. The plugin is ready to run (node_modules included)
61+
62+
## Assets
63+
- `typescript-plugin.tar.gz` - Compiled plugin with dependencies
64+
files: |
65+
plugin/typescript/release/typescript-plugin.tar.gz
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.ref }}
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v5
@@ -39,6 +41,7 @@ jobs:
3941
uses: softprops/action-gh-release@v2
4042
with:
4143
tag_name: ${{ github.event.inputs.tag }}
44+
target_commitish: ${{ github.sha }}
4245
files: |
4346
dist/cli-linux-amd64
4447
dist/cli-linux-arm64

0 commit comments

Comments
 (0)