Skip to content

Commit 925312e

Browse files
author
Meyn
committed
Implement basic Indexer and Provider
1 parent 88eaf71 commit 925312e

28 files changed

+2216
-0
lines changed

.github/workflows/build.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Build Plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
13+
DOTNET_CLI_TELEMETRY_OPTOUT: true
14+
DOTNET_VERSION: 8.0.404
15+
16+
jobs:
17+
build:
18+
strategy:
19+
matrix:
20+
framework: [ net6.0 ]
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- name: Extract version from tag
29+
id: extract_version
30+
run: |
31+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
32+
echo "Extracted version: $TAG_VERSION"
33+
echo "PACKAGE_VERSION=$TAG_VERSION" >> $GITHUB_ENV
34+
35+
- name: Extract repository name without owner
36+
id: extract_repo_name
37+
run: |
38+
REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)
39+
echo "Repository name: $REPO_NAME"
40+
echo "PLUGIN_NAME=$REPO_NAME" >> $GITHUB_ENV
41+
42+
- name: Setup .NET Core
43+
uses: actions/setup-dotnet@v4
44+
with:
45+
dotnet-version: ${{ env.DOTNET_VERSION }}
46+
47+
- name: Create global.json
48+
run: |
49+
echo '{"sdk":{"version": "${{ env.DOTNET_VERSION }}"}}' > ./global.json
50+
51+
- name: Build with package version
52+
run: |
53+
dotnet build *.sln -c Release -f ${{ matrix.framework }} -p:Version=${{ env.PACKAGE_VERSION }} -p:AssemblyVersion=${{ env.PACKAGE_VERSION }} -p:FileVersion=${{ env.PACKAGE_VERSION }}
54+
55+
- name: Find Plugin Output Directory
56+
id: find_plugin_dir
57+
run: |
58+
PLUGIN_OUTPUT_DIR=$(find . -type d -path "*/_plugins/*/${{ env.PLUGIN_NAME }}" | head -n 1)
59+
if [ -z "$PLUGIN_OUTPUT_DIR" ]; then
60+
echo "Error: Plugin output directory not found!"
61+
exit 1
62+
fi
63+
echo "PLUGIN_OUTPUT_DIR=$PLUGIN_OUTPUT_DIR" >> $GITHUB_OUTPUT
64+
65+
- name: Zip files matching pattern
66+
run: |
67+
cd ./_plugins/net6.0/${{ env.PLUGIN_NAME }}/
68+
zip -r ${{ env.PLUGIN_NAME }}-v${{ env.PACKAGE_VERSION }}.${{ matrix.framework }}.zip *.${{ env.PLUGIN_NAME }}.* *.Plugin.${{ env.PLUGIN_NAME }}.*
69+
70+
- name: Get commit messages since last release
71+
id: get_commit_messages
72+
run: |
73+
LAST_TAG=$(git describe --tags --abbrev=0 ${{ github.ref }}^ 2>/dev/null || true)
74+
if [ -z "$LAST_TAG" ]; then
75+
echo "No previous tag found. Using initial commit."
76+
COMMIT_MESSAGES=$(git log --pretty=format:"- %s")
77+
else
78+
COMMIT_MESSAGES=$(git log $LAST_TAG..${{ github.ref }} --pretty=format:"- %s")
79+
fi
80+
echo "COMMIT_MESSAGES<<EOF" >> $GITHUB_ENV
81+
echo "$COMMIT_MESSAGES" >> $GITHUB_ENV
82+
echo "EOF" >> $GITHUB_ENV
83+
84+
- name: Debug environment variables
85+
run: |
86+
echo "COMMIT_MESSAGES: $COMMIT_MESSAGES"
87+
echo "TAG_DESCRIPTION: $TAG_DESCRIPTION"
88+
89+
- name: Create GitHub Release and Upload Artifact
90+
uses: softprops/action-gh-release@v1
91+
with:
92+
tag_name: ${{ github.ref }}
93+
name: 🚀 Release ${{ env.PACKAGE_VERSION }}
94+
body: |
95+
### 📝 **Changes**
96+
${{ env.COMMIT_MESSAGES }}
97+
98+
----
99+
100+
### 📦 **Artifact**
101+
The plugin artifact is attached to this release. Download it below!
102+
files: |
103+
${{ steps.find_plugin_dir.outputs.PLUGIN_OUTPUT_DIR }}/${{ env.PLUGIN_NAME }}-v${{ env.PACKAGE_VERSION }}.${{ matrix.framework }}.zip

0 commit comments

Comments
 (0)