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