Skip to content

Commit f69d332

Browse files
committed
prepare for release
1 parent b522112 commit f69d332

File tree

4 files changed

+279
-0
lines changed

4 files changed

+279
-0
lines changed

.github/workflows/release.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Create Release Archive
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # Matches tags like v1.0.0, v2.1.3, etc.
7+
8+
jobs:
9+
package-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Get tag name
19+
id: tag
20+
run: |
21+
TAG_NAME=${GITHUB_REF#refs/tags/}
22+
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
23+
echo "Tag: ${TAG_NAME}"
24+
25+
- name: Check if release exists
26+
id: check_release
27+
run: |
28+
RELEASE_ID=$(curl -s \
29+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
30+
-H "Accept: application/vnd.github.v3+json" \
31+
"https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.tag.outputs.tag_name }}" | jq -r '.id // empty')
32+
33+
if [ -n "$RELEASE_ID" ]; then
34+
echo "release_id=${RELEASE_ID}" >> $GITHUB_OUTPUT
35+
echo "release_exists=true" >> $GITHUB_OUTPUT
36+
echo "Found existing release: ${RELEASE_ID}"
37+
else
38+
echo "release_exists=false" >> $GITHUB_OUTPUT
39+
echo "Release does not exist, will create it"
40+
fi
41+
42+
- name: Create release if needed
43+
id: create_release
44+
if: steps.check_release.outputs.release_exists == 'false'
45+
run: |
46+
RESPONSE=$(curl -s -X POST \
47+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
48+
-H "Accept: application/vnd.github.v3+json" \
49+
"https://api.github.com/repos/${{ github.repository }}/releases" \
50+
-d "{\"tag_name\":\"${{ steps.tag.outputs.tag_name }}\",\"name\":\"${{ steps.tag.outputs.tag_name }}\",\"draft\":false,\"prerelease\":false}")
51+
52+
RELEASE_ID=$(echo $RESPONSE | jq -r '.id')
53+
UPLOAD_URL=$(echo $RESPONSE | jq -r '.upload_url')
54+
echo "release_id=${RELEASE_ID}" >> $GITHUB_OUTPUT
55+
echo "upload_url=${UPLOAD_URL}" >> $GITHUB_OUTPUT
56+
echo "Created release: ${RELEASE_ID}"
57+
58+
- name: Get release upload URL
59+
id: get_upload_url
60+
if: steps.check_release.outputs.release_exists == 'true'
61+
run: |
62+
UPLOAD_URL=$(curl -s \
63+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
64+
-H "Accept: application/vnd.github.v3+json" \
65+
"https://api.github.com/repos/${{ github.repository }}/releases/${{ steps.check_release.outputs.release_id }}" | jq -r '.upload_url')
66+
echo "upload_url=${UPLOAD_URL}" >> $GITHUB_OUTPUT
67+
68+
- name: Set upload URL
69+
id: set_upload_url
70+
run: |
71+
if [ "${{ steps.create_release.outputs.upload_url }}" != "" ]; then
72+
echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_OUTPUT
73+
else
74+
echo "upload_url=${{ steps.get_upload_url.outputs.upload_url }}" >> $GITHUB_OUTPUT
75+
fi
76+
77+
- name: Create .agents archive
78+
run: |
79+
# Create a temporary directory for the archive
80+
mkdir -p release-package/.agents
81+
82+
# Copy all files from .agents folder
83+
cp -r .agents/* release-package/.agents/
84+
85+
# Copy the AGENTS-pinecone-snippet.md file for easy integration
86+
cp AGENTS-pinecone-snippet.md release-package/
87+
88+
# Create zip archive
89+
cd release-package
90+
zip -r ../agents.zip .
91+
cd ..
92+
93+
# Create tar.gz archive (alternative format)
94+
cd release-package
95+
tar -czf ../agents.tar.gz .
96+
cd ..
97+
98+
# List contents for verification
99+
echo "Archive contents:"
100+
unzip -l agents.zip
101+
102+
- name: Upload ZIP archive to release
103+
run: |
104+
UPLOAD_URL="${{ steps.set_upload_url.outputs.upload_url }}"
105+
UPLOAD_URL="${UPLOAD_URL%\{?name,label\}}"
106+
curl \
107+
-X POST \
108+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
109+
-H "Content-Type: application/zip" \
110+
--data-binary @"agents.zip" \
111+
"${UPLOAD_URL}?name=agents.zip"
112+
113+
- name: Upload TAR.GZ archive to release
114+
run: |
115+
UPLOAD_URL="${{ steps.set_upload_url.outputs.upload_url }}"
116+
UPLOAD_URL="${UPLOAD_URL%\{?name,label\}}"
117+
curl \
118+
-X POST \
119+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
120+
-H "Content-Type: application/gzip" \
121+
--data-binary @"agents.tar.gz" \
122+
"${UPLOAD_URL}?name=agents.tar.gz"
123+
124+
- name: Display release information
125+
run: |
126+
echo "✅ Release assets created successfully!"
127+
echo "📦 agents.zip - ZIP archive containing .agents folder and integration files"
128+
echo "📦 agents.tar.gz - TAR.GZ archive containing .agents folder and integration files"
129+
echo ""
130+
echo "Release tag: ${{ steps.tag.outputs.tag_name }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp

AGENTS-pinecone-snippet.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Pinecone (Vector Database)
2+
3+
**Main documentation**: [`.agents/PINECONE.md`](.agents/PINECONE.md) - Universal concepts, CLI vs SDK guidance, common patterns, and navigation guide
4+
5+
**Additional resources**:
6+
7+
- `.agents/PINECONE-quickstart.md` - Step-by-step tutorials (Quick Test, Search, RAG, Recommendations)
8+
- `.agents/PINECONE-cli.md` - CLI installation, authentication, and command reference
9+
- `.agents/PINECONE-python.md` - Python SDK guide with code examples
10+
- `.agents/PINECONE-typescript.md` - TypeScript/Node.js SDK guide with code examples
11+
- `.agents/PINECONE-go.md` - Go SDK guide with code examples
12+
- `.agents/PINECONE-java.md` - Java SDK guide with code examples
13+
14+
**When users ask about Pinecone**: Start with `.agents/PINECONE.md` and use the "Choosing the Right Guide" section to navigate to the appropriate file.

README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Pinecone Agent Reference
2+
3+
This repository contains specialized agent instructions for the Pinecone vector database, designed to be integrated into your project's `AGENTS.md` file for use with AI coding assistants.
4+
5+
## What's Included
6+
7+
This repository provides comprehensive Pinecone documentation organized into the `.agents/` folder:
8+
9+
- **PINECONE.md** - Universal concepts, CLI vs SDK guidance, common patterns, and navigation guide
10+
- **PINECONE-quickstart.md** - Step-by-step tutorials (Quick Test, Search, RAG, Recommendations)
11+
- **PINECONE-cli.md** - CLI installation, authentication, and command reference
12+
- **PINECONE-python.md** - Python SDK guide with code examples
13+
- **PINECONE-typescript.md** - TypeScript/Node.js SDK guide with code examples
14+
- **PINECONE-go.md** - Go SDK guide with code examples
15+
- **PINECONE-java.md** - Java SDK guide with code examples
16+
17+
## Quick Start
18+
19+
Install with three simple commands:
20+
21+
```bash
22+
# 1. Download the latest release
23+
curl -L -o agents.zip https://github.com/pinecone-io/pinecone-agents-ref/releases/latest/download/agents.zip
24+
25+
# 2. Extract the archive
26+
unzip agents.zip && rm agents.zip
27+
28+
# 3. Add Pinecone section to AGENTS.md (creates it if it doesn't exist)
29+
touch AGENTS.md && cat AGENTS-pinecone-snippet.md >> AGENTS.md && rm AGENTS-pinecone-snippet.md
30+
```
31+
32+
That's it! Your project now has the `.agents/` folder with all Pinecone documentation and your `AGENTS.md` file has been updated.
33+
34+
### Verify Installation
35+
36+
After running the commands above, you should have:
37+
38+
```
39+
your-project/
40+
├── .agents/ # Agent documentation folder
41+
│ ├── PINECONE.md # Main universal guide
42+
│ ├── PINECONE-quickstart.md # Quickstart tutorials
43+
│ ├── PINECONE-cli.md # CLI documentation
44+
│ ├── PINECONE-python.md # Python SDK guide
45+
│ ├── PINECONE-typescript.md # TypeScript/Node.js SDK guide
46+
│ ├── PINECONE-go.md # Go SDK guide
47+
│ └── PINECONE-java.md # Java SDK guide
48+
└── AGENTS.md # Your project's agent guide (with Pinecone section)
49+
50+
```
51+
52+
### Customizing the Integration
53+
54+
The third command appends `AGENTS-pinecone-snippet.md` to your `AGENTS.md`. If you already have an `AGENTS.md` file and want more control over where the Pinecone section is placed:
55+
56+
1. Extract the archive: `unzip agents.zip && rm agents.zip`
57+
2. Open `AGENTS-pinecone-snippet.md` and copy the "Pinecone (Vector Database)" section
58+
3. Manually add it to your `AGENTS.md` where you prefer
59+
4. Remove the snippet file: `rm AGENTS-pinecone-snippet.md`
60+
61+
## Updating
62+
63+
To update to a newer version:
64+
65+
```bash
66+
# Download the latest version
67+
curl -L -o agents.zip https://github.com/pinecone-io/pinecone-agents-ref/releases/latest/download/agents.zip
68+
rm -rf .agents && unzip agents.zip && rm agents.zip
69+
# AGENTS.md typically doesn't need changes unless the structure changes
70+
```
71+
72+
## Usage
73+
74+
Once installed, your AI coding assistant will automatically reference the `.agents/PINECONE.md` files when users ask questions about Pinecone. The main guide provides navigation to language-specific documentation based on the user's needs.
75+
76+
## For Maintainers: Creating Releases
77+
78+
The included GitHub Actions workflow (`.github/workflows/release.yml`) automatically packages and creates releases when you push a version tag.
79+
80+
### How to Create a Release
81+
82+
Simply tag and push your code:
83+
84+
```bash
85+
git tag v1.0.0
86+
git push origin v1.0.0
87+
```
88+
89+
The workflow will automatically:
90+
91+
1. Detect the version tag (matches `v*` pattern, e.g., `v1.0.0`, `v2.1.3`)
92+
2. Create a GitHub release if one doesn't already exist for that tag
93+
3. Package all files from the `.agents/` folder
94+
4. Include the `AGENTS-pinecone-snippet.md` file for easy integration
95+
5. Create both `agents.zip` and `agents.tar.gz` archives
96+
6. Attach both archives to the release as downloadable assets
97+
98+
### How It Works
99+
100+
The workflow triggers automatically on tag push (`push: tags: v*`) and:
101+
102+
1. Extracts the tag name (e.g., `v1.0.0`)
103+
2. Checks if a GitHub release already exists for that tag
104+
- If a release exists → uses that release and attaches assets
105+
- If no release exists → creates a new release automatically
106+
3. Packages the following files:
107+
- All files from `.agents/` folder (7 Pinecone documentation files)
108+
- `AGENTS-pinecone-snippet.md` file
109+
4. Creates archives with the structure:
110+
```
111+
archive/
112+
├── .agents/
113+
│ ├── PINECONE.md
114+
│ ├── PINECONE-quickstart.md
115+
│ ├── PINECONE-cli.md
116+
│ ├── PINECONE-python.md
117+
│ ├── PINECONE-typescript.md
118+
│ ├── PINECONE-go.md
119+
│ └── PINECONE-java.md
120+
└── AGENTS-pinecone-snippet.md
121+
```
122+
5. Uploads both `agents.zip` and `agents.tar.gz` to the release
123+
124+
### Manual Release Option
125+
126+
You can still create releases manually through the GitHub UI if you prefer. If you create a release for a tag that doesn't have assets yet, you can manually trigger the workflow or just push the tag again to have it run automatically.
127+
128+
## Contributing
129+
130+
Issues and pull requests are welcome! Please see the repository's contribution guidelines (if available).
131+
132+
## License
133+
134+
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)