-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 3 KB
/
Copy pathpublish.yml
File metadata and controls
100 lines (83 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Publish Plugin
on:
push:
tags:
- 'v*'
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Verify version matches manifest
id: version
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
MANIFEST_VERSION=$(jq -r '.version' manifest.json)
echo "Tag version: $TAG_VERSION"
echo "Manifest version: $MANIFEST_VERSION"
if [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then
echo "Version mismatch! Tag is v$TAG_VERSION but manifest.json says $MANIFEST_VERSION"
exit 1
fi
echo "VERSION=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Format check
run: deno task fmt:check
- name: Lint
run: deno task lint
- name: Run tests
run: deno task test
release:
name: Create Release
needs: validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get plugin metadata
id: meta
run: |
echo "NAME=$(jq -r '.name' manifest.json)" >> $GITHUB_OUTPUT
echo "DESCRIPTION=$(jq -r '.description' manifest.json | head -c 200)" >> $GITHUB_OUTPUT
echo "VERSION=v$(jq -r '.version' manifest.json)" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.meta.outputs.VERSION }}
body: |
## ${{ steps.meta.outputs.NAME }} ${{ steps.meta.outputs.VERSION }}
${{ steps.meta.outputs.DESCRIPTION }}
### Installation
```bash
cortex plugin install github:${{ github.repository }}
```
### Marketplace
Submit at: https://cortexprism.io/marketplace/publish/plugin
**Repository:** [${{ github.repository }}](https://github.com/${{ github.repository }})
files: |
manifest.json
mod.ts
README.md
CHANGELOG.md
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Submission reminder
run: |
echo "✅ Plugin published: ${{ steps.meta.outputs.NAME }} ${{ steps.meta.outputs.VERSION }}"
echo ""
echo "📝 Marketplace submission: https://cortexprism.io/marketplace/publish/plugin"
echo ""
echo "Submission checklist:"
echo " ✓ Plugin name: ${{ steps.meta.outputs.NAME }}"
echo " ✓ Version: ${{ steps.meta.outputs.VERSION }}"
echo " ✓ Repository: ${{ github.repositoryUrl }}"
echo " ✓ Tests passing: true"
echo " ✓ Lint passing: true"