forked from AG_QGIS/Plugin_Test_Action
Compare commits
31 Commits
v20-testin
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aecf203932 | ||
|
|
3ee93bdc0d | ||
|
|
8ee99fa5da | ||
|
|
98fb235fb9 | ||
|
|
a58f6255fc | ||
|
|
78ffc6d6d2 | ||
|
|
00785eeabd | ||
|
|
8f0e6a9978 | ||
|
|
5f756be077 | ||
|
|
a6837e5fd2 | ||
|
|
dac2a8e973 | ||
|
|
0fa2861040 | ||
|
|
4790001f30 | ||
|
|
2eacee23f5 | ||
|
|
5d12fefb1d | ||
|
|
495a4ac049 | ||
|
|
a69d00df31 | ||
|
|
f77a8d34a0 | ||
|
|
2cb504ba51 | ||
|
|
44aae815f5 | ||
|
|
af43bfeab9 | ||
|
|
c55dedbbe1 | ||
|
|
067e0f3170 | ||
|
|
2e65ec4bc4 | ||
|
|
0ce29c9e84 | ||
|
|
75b7e8073a | ||
|
|
88a62af7c8 | ||
|
|
049c0f64ed | ||
|
|
efc695457f | ||
|
|
c73cde2e57 | ||
|
|
18e76984bb |
@@ -1,4 +1,3 @@
|
|||||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
||||||
name: Release Plugin
|
name: Release Plugin
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -24,11 +23,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Tag aus GitHub Actions Kontext extrahieren
|
# Tag aus GitHub Actions Kontext extrahieren
|
||||||
TAG="${GITHUB_REF#refs/tags/}"
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
echo "DEBUG | Tag erkannt: $TAG"
|
|
||||||
|
|
||||||
# Repo-URL dynamisch aus vars und github.repository bauen
|
# Repo-URL dynamisch aus vars und github.repository bauen
|
||||||
REPO_URL="https://${RELEASE_TOKEN}:x-oauth-basic@${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}.git"
|
REPO_URL="https://${RELEASE_TOKEN}:x-oauth-basic@${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}.git"
|
||||||
echo "DEBUG | Klone von: $REPO_URL"
|
|
||||||
|
|
||||||
# Repository klonen
|
# Repository klonen
|
||||||
git clone "$REPO_URL" repo
|
git clone "$REPO_URL" repo
|
||||||
@@ -43,53 +40,103 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
TAG="${{ github.ref_name }}"
|
TAG="${{ github.ref_name }}"
|
||||||
VERSION="${TAG#v}"
|
VERSION="${TAG#v}"
|
||||||
|
|
||||||
case "$TAG" in
|
case "$TAG" in
|
||||||
*-unstable*) CHANNEL="unstable" ;;
|
*-unstable*)
|
||||||
*-testing*) CHANNEL="testing" ;;
|
CHANNEL="unstable"
|
||||||
*) CHANNEL="stable" ;;
|
DRAFT="false"
|
||||||
|
PRERELEASE="true"
|
||||||
|
;;
|
||||||
|
*-testing*)
|
||||||
|
CHANNEL="testing"
|
||||||
|
DRAFT="true"
|
||||||
|
PRERELEASE="false"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CHANNEL="stable"
|
||||||
|
DRAFT="false"
|
||||||
|
PRERELEASE="false"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "channel=${CHANNEL}" >> $GITHUB_OUTPUT
|
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
|
||||||
|
echo "draft=$DRAFT" >> $GITHUB_OUTPUT
|
||||||
|
echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "DEBUG | Version: $VERSION"
|
- name: plugin.info einlesen
|
||||||
echo "DEBUG | Kanal: $CHANNEL"
|
id: info
|
||||||
|
run: |
|
||||||
|
cd repo
|
||||||
|
while IFS='=' read -r key value; do
|
||||||
|
echo "$key=$value" >> $GITHUB_OUTPUT
|
||||||
|
done < plugin.info
|
||||||
|
|
||||||
|
- name: Changelog einlesen
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
cd repo
|
||||||
|
|
||||||
|
# Aktueller Block = alles vor dem ersten ---
|
||||||
|
CURRENT=$(awk '/^---/{exit} {print}' changelog.txt)
|
||||||
|
|
||||||
|
# Vollständige Historie = alles nach dem ersten ---
|
||||||
|
HISTORY=$(awk 'found{print} /^---/{found=1}' changelog.txt)
|
||||||
|
|
||||||
|
# Gitea Release Body zusammenbauen
|
||||||
|
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
||||||
|
FULL=$(printf "## %s\n%s\n\n%s" "$VERSION" "$CURRENT" "$HISTORY")
|
||||||
|
|
||||||
|
echo "DEBUG | Aktueller Changelog:"
|
||||||
|
echo "$CURRENT"
|
||||||
|
|
||||||
|
# Für GITHUB_OUTPUT: Multiline via EOF-Marker
|
||||||
|
echo "current<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "$CURRENT" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
echo "full<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "$FULL" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: metadata.txt erzeugen
|
- name: metadata.txt erzeugen
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd repo
|
||||||
|
|
||||||
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
TEMPLATE="templates/metadata.template"
|
||||||
|
OUT="metadata.txt"
|
||||||
|
|
||||||
# Vorlage kopieren
|
CONTENT=$(cat "$TEMPLATE")
|
||||||
cp .plugin/metadata.template metadata.txt
|
|
||||||
|
|
||||||
# Platzhalter ersetzen
|
CONTENT="${CONTENT//\{\{NAME\}\}/${{ steps.info.outputs.name }}}"
|
||||||
sed -i "s/@VERSION@/${VERSION}/g" metadata.txt
|
CONTENT="${CONTENT//\{\{QGIS_MIN\}\}/${{ steps.info.outputs.qgisMinimumVersion }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{QGIS_MAX\}\}/${{ steps.info.outputs.qgisMaximumVersion }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{DESCRIPTION\}\}/${{ steps.info.outputs.description }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{VERSION\}\}/${{ steps.releaseinfo.outputs.version }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{AUTHOR\}\}/${{ steps.info.outputs.author }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{EMAIL\}\}/${{ steps.info.outputs.email }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{HOMEPAGE\}\}/${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}}"
|
||||||
|
CONTENT="${CONTENT//\{\{TRACKER\}\}/${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}}"
|
||||||
|
CONTENT="${CONTENT//\{\{REPOSITORY\}\}/${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}}"
|
||||||
|
CONTENT="${CONTENT//\{\{EXPERIMENTAL\}\}/${{ steps.info.outputs.experimental }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{DEPRECATED\}\}/${{ steps.info.outputs.deprecated }}}"
|
||||||
|
CONTENT="${CONTENT//\{\{QT6\}\}/${{ steps.info.outputs.supportsQt6 }}}"
|
||||||
|
|
||||||
echo "DEBUG | metadata.txt erzeugt:"
|
printf "%s\n" "$CONTENT" > "$OUT"
|
||||||
cat metadata.txt
|
|
||||||
|
|
||||||
- name: ZIP-Datei erstellen
|
- name: ZIP-Datei erstellen
|
||||||
id: zip
|
id: zip
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd repo
|
||||||
|
|
||||||
# Plugin-Ordnername aus .plugin/zip_folder lesen
|
ZIP_FOLDER="${{ steps.info.outputs.zip_folder }}"
|
||||||
ZIP_FOLDER=$(cat .plugin/zip_folder)
|
|
||||||
echo "DEBUG | Plugin-Ordnername: $ZIP_FOLDER"
|
|
||||||
|
|
||||||
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
||||||
REPO_NAME="${GITHUB_REPOSITORY##*/}"
|
REPO_NAME="${GITHUB_REPOSITORY##*/}"
|
||||||
ZIP_NAME="${REPO_NAME}-${VERSION}.zip"
|
ZIP_NAME="${REPO_NAME}-${VERSION}.zip"
|
||||||
|
|
||||||
echo "DEBUG | ZIP wird erzeugt: $ZIP_NAME"
|
|
||||||
|
|
||||||
# Temporären Build-Ordner anlegen
|
|
||||||
mkdir -p dist/${ZIP_FOLDER}
|
mkdir -p dist/${ZIP_FOLDER}
|
||||||
|
|
||||||
# Plugin-Dateien kopieren (alles außer CI-/Meta-Verzeichnisse)
|
|
||||||
rsync -a \
|
rsync -a \
|
||||||
--exclude='.git' \
|
--exclude='.git' \
|
||||||
--exclude='.gitea' \
|
--exclude='.gitea' \
|
||||||
@@ -97,42 +144,36 @@ jobs:
|
|||||||
--exclude='dist' \
|
--exclude='dist' \
|
||||||
./ dist/${ZIP_FOLDER}/
|
./ dist/${ZIP_FOLDER}/
|
||||||
|
|
||||||
# ZIP erzeugen
|
|
||||||
cd dist
|
cd dist
|
||||||
zip -r "${ZIP_NAME}" "${ZIP_FOLDER}/" \
|
zip -r "${ZIP_NAME}" "${ZIP_FOLDER}/" \
|
||||||
-x "*.pyc" -x "*/__pycache__/*"
|
-x "*.pyc" -x "*/__pycache__/*"
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# ZIP-Name für spätere Steps bereitstellen
|
|
||||||
echo "zip_name=${ZIP_NAME}" >> $GITHUB_OUTPUT
|
echo "zip_name=${ZIP_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "DEBUG | ZIP-Datei erzeugt: dist/${ZIP_NAME}"
|
- name: Gitea-Release erstellen
|
||||||
|
|
||||||
- name: Gitea‑Release erstellen
|
|
||||||
id: create_release
|
id: create_release
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.ref_name }}"
|
TAG="${{ github.ref_name }}"
|
||||||
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
||||||
CHANNEL="${{ steps.releaseinfo.outputs.channel }}"
|
CHANNEL="${{ steps.releaseinfo.outputs.channel }}"
|
||||||
|
|
||||||
echo "Erstelle Release für Tag: $TAG"
|
|
||||||
echo "Version: $VERSION"
|
|
||||||
echo "Kanal: $CHANNEL"
|
|
||||||
|
|
||||||
API_URL="https://${{ vars.RELEASE_URL }}/api/v1/repos/${GITHUB_REPOSITORY}/releases"
|
API_URL="https://${{ vars.RELEASE_URL }}/api/v1/repos/${GITHUB_REPOSITORY}/releases"
|
||||||
|
|
||||||
# JSON‑Body erzeugen
|
|
||||||
JSON=$(jq -n \
|
JSON=$(jq -n \
|
||||||
--arg tag "$TAG" \
|
--arg tag "$TAG" \
|
||||||
--arg name "Version $VERSION" \
|
--arg name "Version $VERSION" \
|
||||||
--arg body "Automatisch erzeugtes Release für Kanal: $CHANNEL" \
|
--arg body "${{ steps.changelog.outputs.current }}" \
|
||||||
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')
|
--argjson draft "${{ steps.releaseinfo.outputs.draft }}" \
|
||||||
|
--argjson prerelease "${{ steps.releaseinfo.outputs.prerelease }}" \
|
||||||
|
'{tag_name: $tag, name: $name, body: $body, draft: $draft, prerelease: $prerelease}')
|
||||||
|
|
||||||
echo "Sende API‑Request an: $API_URL"
|
# JSON=$(jq -n \
|
||||||
echo "JSON‑Payload:"
|
# --arg tag "$TAG" \
|
||||||
echo "$JSON"
|
# --arg name "Version $VERSION" \
|
||||||
|
# --arg body "${{ steps.changelog.outputs.current }}" \
|
||||||
|
# '{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')
|
||||||
|
|
||||||
# Release erstellen
|
|
||||||
API_RESPONSE=$(curl -s -X POST "$API_URL" \
|
API_RESPONSE=$(curl -s -X POST "$API_URL" \
|
||||||
-H "accept: application/json" \
|
-H "accept: application/json" \
|
||||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
@@ -141,198 +182,97 @@ jobs:
|
|||||||
|
|
||||||
RELEASE_ID=$(echo "$API_RESPONSE" | jq -r '.id')
|
RELEASE_ID=$(echo "$API_RESPONSE" | jq -r '.id')
|
||||||
|
|
||||||
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||||
echo "Fehler beim Erstellen des Releases!"
|
echo "Fehler beim Erstellen des Releases!"
|
||||||
echo "API‑Antwort:"
|
echo "$API_RESPONSE"
|
||||||
echo "$API_RESPONSE"
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: ZIP-Datei hochladen
|
||||||
|
run: |
|
||||||
|
RELEASE_ID="${{ steps.create_release.outputs.release_id }}"
|
||||||
|
ZIP_NAME="${{ steps.zip.outputs.zip_name }}"
|
||||||
|
|
||||||
|
API_URL="https://${{ vars.RELEASE_URL }}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${ZIP_NAME}"
|
||||||
|
|
||||||
|
curl -s -X POST "$API_URL" \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/zip" \
|
||||||
|
--data-binary "@repo/dist/${ZIP_NAME}" \
|
||||||
|
-o upload_response.json
|
||||||
|
|
||||||
|
# Optional: Fehlerprüfung
|
||||||
|
if jq -e '.id' upload_response.json >/dev/null 2>&1; then
|
||||||
|
echo "ZIP erfolgreich hochgeladen."
|
||||||
|
else
|
||||||
|
echo "Fehler beim Hochladen der ZIP!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Release erfolgreich erstellt. ID: $RELEASE_ID"
|
- name: Payload erzeugen
|
||||||
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
|
|
||||||
- name: Debug Info
|
|
||||||
run: |
|
run: |
|
||||||
echo "Tag: $GITEA_REF_NAME"
|
cd repo
|
||||||
uname -a
|
|
||||||
|
|
||||||
# - name: Read plugin.cfg
|
VERSION="${{ steps.releaseinfo.outputs.version }}"
|
||||||
# id: cfg
|
CHANNEL="${{ steps.releaseinfo.outputs.channel }}"
|
||||||
# run: |
|
ZIP_NAME="${{ steps.zip.outputs.zip_name }}"
|
||||||
# CFG=".plugin/plugin.cfg"
|
|
||||||
|
|
||||||
# get_value() {
|
DOWNLOAD_URL="https://${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}/releases/download/${{ github.ref_name }}/${ZIP_NAME}"
|
||||||
# grep -i "^$1" "$CFG" | head -1 | cut -d= -f2- | tr -d '\r' | xargs
|
|
||||||
# }
|
|
||||||
|
|
||||||
# echo "zip_folder=$(get_value zip_folder)" >> $GITHUB_OUTPUT
|
jq -n \
|
||||||
# echo "name=$(get_value name)" >> $GITHUB_OUTPUT
|
--arg name "${{ steps.info.outputs.name }}" \
|
||||||
# echo "qgis_min=$(get_value qgisMinimumVersion)" >> $GITHUB_OUTPUT
|
--arg version "$VERSION" \
|
||||||
# echo "qgis_max=$(get_value qgisMaximumVersion)" >> $GITHUB_OUTPUT
|
--arg channel "$CHANNEL" \
|
||||||
# echo "description=$(get_value description)" >> $GITHUB_OUTPUT
|
--arg description "${{ steps.info.outputs.description }}" \
|
||||||
# echo "author=$(get_value author)" >> $GITHUB_OUTPUT
|
--arg author "${{ steps.info.outputs.author }}" \
|
||||||
# echo "email=$(get_value email)" >> $GITHUB_OUTPUT
|
--arg email "${{ steps.info.outputs.email }}" \
|
||||||
# echo "homepage=$(get_value homepage)" >> $GITHUB_OUTPUT
|
--arg qgis_min "${{ steps.info.outputs.qgisMinimumVersion }}" \
|
||||||
# echo "tracker=$(get_value tracker)" >> $GITHUB_OUTPUT
|
--arg qgis_max "${{ steps.info.outputs.qgisMaximumVersion }}" \
|
||||||
# echo "repository=$(get_value repository)" >> $GITHUB_OUTPUT
|
--arg homepage "${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}" \
|
||||||
# echo "experimental=$(get_value experimental)" >> $GITHUB_OUTPUT
|
--arg tracker "${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}" \
|
||||||
# echo "deprecated=$(get_value deprecated)" >> $GITHUB_OUTPUT
|
--arg repository "${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}" \
|
||||||
|
--arg experimental "${{ steps.info.outputs.experimental }}" \
|
||||||
|
--arg deprecated "${{ steps.info.outputs.deprecated }}" \
|
||||||
|
--arg qt6 "${{ steps.info.outputs.supportsQt6 }}" \
|
||||||
|
--arg id "${{ steps.info.outputs.zip_folder }}" \
|
||||||
|
--arg url "$DOWNLOAD_URL" \
|
||||||
|
--arg changelog "${{ steps.changelog.outputs.current }}" \
|
||||||
|
'{
|
||||||
|
name: $name,
|
||||||
|
version: $version,
|
||||||
|
channel: $channel,
|
||||||
|
description: $description,
|
||||||
|
author: $author,
|
||||||
|
email: $email,
|
||||||
|
qgis_min: $qgis_min,
|
||||||
|
qgis_max: $qgis_max,
|
||||||
|
homepage: $homepage,
|
||||||
|
tracker: $tracker,
|
||||||
|
repository: $repository,
|
||||||
|
experimental: $experimental,
|
||||||
|
deprecated: $deprecated,
|
||||||
|
qt6: $qt6,
|
||||||
|
id: $id,
|
||||||
|
url: $url,
|
||||||
|
changelog: $changelog
|
||||||
|
}' > payload.json
|
||||||
|
|
||||||
# # Nur fürs Log:
|
- name: Repository aktualisieren
|
||||||
# echo "zip_folder=$(get_value zip_folder)"
|
run: |
|
||||||
# echo "name=$(get_value name)"
|
OWNER="AG_QGIS"
|
||||||
# echo "qgis_min=$(get_value qgisMinimumVersion)"
|
WORKFLOW="update.yml"
|
||||||
# echo "qgis_max=$(get_value qgisMaximumVersion)"
|
|
||||||
# echo "description=$(get_value description)"
|
|
||||||
# echo "author=$(get_value author)"
|
|
||||||
# echo "email=$(get_value email)"
|
|
||||||
# echo "homepage=$(get_value homepage)"
|
|
||||||
# echo "tracker=$(get_value tracker)"
|
|
||||||
# echo "repository=$(get_value repository)"
|
|
||||||
# echo "experimental=$(get_value experimental)"
|
|
||||||
# echo "deprecated=$(get_value deprecated)"
|
|
||||||
|
|
||||||
# - name: Generate metadata.txt
|
PAYLOAD_B64=$(base64 -w0 repo/payload.json)
|
||||||
# run: |
|
|
||||||
# VERSION="${{ steps.info.outputs.version }}"
|
|
||||||
# CHANGELOG=$(cat .plugin/changelog.txt)
|
|
||||||
|
|
||||||
# cat > metadata.txt << EOF
|
JSON="{\"ref\":\"feature/release\",\"inputs\":{\"payload\":\"$PAYLOAD_B64\"}}"
|
||||||
# [general]
|
|
||||||
# name=${{ steps.cfg.outputs.name }}
|
|
||||||
# version=${VERSION}
|
|
||||||
# qgisMinimumVersion=${{ steps.cfg.outputs.qgis_min }}
|
|
||||||
# qgisMaximumVersion=${{ steps.cfg.outputs.qgis_max }}
|
|
||||||
# description=${{ steps.cfg.outputs.description }}
|
|
||||||
# author=${{ steps.cfg.outputs.author }}
|
|
||||||
# email=${{ steps.cfg.outputs.email }}
|
|
||||||
# homepage=${{ steps.cfg.outputs.homepage }}
|
|
||||||
# tracker=${{ steps.cfg.outputs.tracker }}
|
|
||||||
# repository=${{ steps.cfg.outputs.repository }}
|
|
||||||
# experimental=${{ steps.cfg.outputs.experimental }}
|
|
||||||
# deprecated=${{ steps.cfg.outputs.deprecated }}
|
|
||||||
# changelog=${VERSION}
|
|
||||||
# $(cat .plugin/changelog.txt)
|
|
||||||
# EOF
|
|
||||||
|
|
||||||
# # Nur fürs Log:
|
echo "DEBUG | Sende JSON:"
|
||||||
# cat metadata.txt
|
echo "$JSON"
|
||||||
|
|
||||||
# - name: Build plugin ZIP
|
curl -X POST \
|
||||||
# run: |
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
# REPO_NAME="${{ github.event.repository.name }}"
|
-H "Content-Type: application/json" \
|
||||||
# ZIP_FOLDER="${{ steps.cfg.outputs.zip_folder }}"
|
-d "$JSON" \
|
||||||
# VERSION="${{ steps.info.outputs.version }}"
|
"https://${{ vars.RELEASE_URL }}/api/v1/repos/${OWNER}/Repository/actions/workflows/${WORKFLOW}/dispatches"
|
||||||
# ZIP_NAME="${REPO_NAME}-${VERSION}.zip"
|
|
||||||
|
|
||||||
# # Temporären Ordner mit zip_folder-Namen anlegen
|
|
||||||
# mkdir -p dist/${ZIP_FOLDER}
|
|
||||||
|
|
||||||
# # Alle Plugin-Dateien hineinkopieren (ohne .gitea, .plugin, dist)
|
|
||||||
# rsync -a \
|
|
||||||
# --exclude='.gitea' \
|
|
||||||
# --exclude='.plugin' \
|
|
||||||
# --exclude='.git' \
|
|
||||||
# --exclude='dist' \
|
|
||||||
# ./ dist/${ZIP_FOLDER}/
|
|
||||||
|
|
||||||
# # ZIP bauen
|
|
||||||
# cd dist
|
|
||||||
# zip -r ${ZIP_NAME} ${ZIP_FOLDER}/ \
|
|
||||||
# -x "*.pyc" -x "*/__pycache__/*"
|
|
||||||
# cd ..
|
|
||||||
|
|
||||||
# echo "ZIP_NAME=${ZIP_NAME}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# # Nur fürs Log:
|
|
||||||
# echo "ZIP_NAME=${ZIP_NAME}"
|
|
||||||
|
|
||||||
# - name: Create Gitea Release
|
|
||||||
# id: create_release
|
|
||||||
# run: |
|
|
||||||
# echo "Kommuniziere mit Gitea API über HTTPS..."
|
|
||||||
# API_RESPONSE=$(curl -s -k -X POST "https://${{ vars.RELEASE_URL }}/api/v1/repos/${{ github.repository }}/releases" \
|
|
||||||
# -H "accept: application/json" \
|
|
||||||
# -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
|
||||||
# -H "Content-Type: application/json" \
|
|
||||||
# -d '{
|
|
||||||
# "body": "Dieses Release wurde automatisch vom Gitea Runner erstellt.",
|
|
||||||
# "draft": false,
|
|
||||||
# "name": "Version ${{ github.ref_name }}",
|
|
||||||
# "prerelease": false,
|
|
||||||
# "tag_name": "${{ github.ref_name }}"
|
|
||||||
# }')
|
|
||||||
|
|
||||||
# RELEASE_ID=$(echo $API_RESPONSE | jq -r '.id')
|
|
||||||
|
|
||||||
# if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
|
||||||
# echo "Fehler beim Erstellen des Releases. API Antwort:"
|
|
||||||
# echo $API_RESPONSE
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# echo "Release ID: $RELEASE_ID"
|
|
||||||
# echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# - name: Upload ZIP asset
|
|
||||||
# id: upload_asset
|
|
||||||
# run: |
|
|
||||||
# echo "Lade release_${{ github.ref_name }}.zip (${{ env.ZIP_NAME }}) hoch..."
|
|
||||||
|
|
||||||
# RESPONSE=$(curl -s -k -X POST \
|
|
||||||
# "https://${{ vars.RELEASE_URL }}/api/v1/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets?name=${{ env.ZIP_NAME }}" \
|
|
||||||
# -H "accept: application/json" \
|
|
||||||
# -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
|
||||||
# -H "Content-Type: multipart/form-data" \
|
|
||||||
# -F "attachment=@dist/${{ env.ZIP_NAME }}")
|
|
||||||
|
|
||||||
# echo "Upload response: $RESPONSE"
|
|
||||||
|
|
||||||
# DOWNLOAD_URL=$(echo "$RESPONSE" | grep -o '"browser_download_url":"[^"]*' | cut -d'"' -f4)
|
|
||||||
# echo "download_url=${DOWNLOAD_URL}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# - name: Build XML block
|
|
||||||
# id: xmlblock
|
|
||||||
# run: |
|
|
||||||
# NAME="${{ steps.cfg.outputs.name }}"
|
|
||||||
# VERSION="${{ steps.info.outputs.version }}"
|
|
||||||
|
|
||||||
# BLOCK=$(cat <<EOF
|
|
||||||
# <pyqgis_plugin name="${NAME}" version="${VERSION}">
|
|
||||||
# <description>${{ steps.cfg.outputs.description }}</description>
|
|
||||||
# <qgisMinimumVersion>${{ steps.cfg.outputs.qgis_min }}</qgisMinimumVersion>
|
|
||||||
# <qgisMaximumVersion>${{ steps.cfg.outputs.qgis_max }}</qgisMaximumVersion>
|
|
||||||
# <author>${{ steps.cfg.outputs.author }}</author>
|
|
||||||
# <email>${{ steps.cfg.outputs.email }}</email>
|
|
||||||
# <homepage>${{ steps.cfg.outputs.homepage }}</homepage>
|
|
||||||
# <tracker>${{ steps.cfg.outputs.tracker }}</tracker>
|
|
||||||
# <repository>${{ steps.cfg.outputs.repository }}</repository>
|
|
||||||
# <download_url>${{ steps.upload_asset.outputs.download_url }}</download_url>
|
|
||||||
# <experimental>${{ steps.cfg.outputs.experimental }}</experimental>
|
|
||||||
# <deprecated>${{ steps.cfg.outputs.deprecated }}</deprecated>
|
|
||||||
# </pyqgis_plugin>
|
|
||||||
# EOF
|
|
||||||
# )
|
|
||||||
|
|
||||||
# {
|
|
||||||
# echo "block<<EOF"
|
|
||||||
# echo "$BLOCK"
|
|
||||||
# echo "EOF"
|
|
||||||
# } >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
# - name: Dispatch to Repository
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# curl -s -X POST \
|
|
||||||
# -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
|
||||||
# -H "Content-Type: application/json" \
|
|
||||||
# "https://${{ vars.RELEASE_URL }}/api/v1/repos/${{ github.repository_owner }}/Repository/dispatches" \
|
|
||||||
# -d "{
|
|
||||||
# \"type\": \"plugin-released\",
|
|
||||||
# \"payload\": {
|
|
||||||
# \"plugin\": \"${{ steps.cfg.outputs.name }}\",
|
|
||||||
# \"channel\": \"${{ steps.info.outputs.channel }}\",
|
|
||||||
# \"xml_block\": \"${{ steps.xmlblock.outputs.block }}\"
|
|
||||||
# }
|
|
||||||
# }"
|
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -174,4 +174,5 @@ cython_debug/
|
|||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
metadata.txt
|
metadata.txt
|
||||||
|
release.cmd
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
[general]
|
|
||||||
name=LNO Sachsen | Plugin Test Action
|
|
||||||
qgisMinimumVersion=3.0
|
|
||||||
qgisMaximumVersion=3.99
|
|
||||||
description=Test plugin for release pipeline
|
|
||||||
version=@VERSION@
|
|
||||||
author=Daniel Helbig, Michael Otto
|
|
||||||
email=daniel.helbig@kreis-meissen.de, michael.otto@landkreis-mittelsachsen.de
|
|
||||||
homepage=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_Test_Action
|
|
||||||
tracker=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_Test_Action/issues
|
|
||||||
repository=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_Test_Action
|
|
||||||
experimental=True
|
|
||||||
deprecated=False
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[general]
|
|
||||||
zip_folder=mein_plugin_ordner
|
|
||||||
name=LNO Sachsen | Plugin Test Action
|
|
||||||
qgisMinimumVersion=3.0
|
|
||||||
qgisMaximumVersion=3.99
|
|
||||||
description=Test plugin for release pipeline
|
|
||||||
version=26.3.1
|
|
||||||
author=Michael Otto
|
|
||||||
email=michael.otto@landkreis-mittelsachsen.de
|
|
||||||
homepage=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_Test_Action
|
|
||||||
tracker=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_Test_Action/issues
|
|
||||||
repository=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_Test_Action
|
|
||||||
experimental=False
|
|
||||||
deprecated=False
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
sn_test
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
0.2.0
|
- Ganz viele neue Sachen
|
||||||
|
---
|
||||||
|
61
|
||||||
- Feature XY hinzugefügt
|
- Feature XY hinzugefügt
|
||||||
- Bug Z behoben
|
- Bug Z behoben
|
||||||
0.1.0
|
0.1.0
|
||||||
11
plugin.info
Normal file
11
plugin.info
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
name=LNO Sachsen | Plugin Test Action
|
||||||
|
description=Test plugin for release pipeline
|
||||||
|
author=Daniel Helbig
|
||||||
|
email=daniel.helbig@kreis-meissen.de
|
||||||
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=3.99
|
||||||
|
deprecated=False
|
||||||
|
experimental=True
|
||||||
|
supportsQt6=Yes
|
||||||
|
|
||||||
|
zip_folder=plugin_folder
|
||||||
14
templates/metadata.template
Normal file
14
templates/metadata.template
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[general]
|
||||||
|
name={{NAME}}
|
||||||
|
qgisMinimumVersion={{QGIS_MIN}}
|
||||||
|
qgisMaximumVersion={{QGIS_MAX}}
|
||||||
|
description={{DESCRIPTION}}
|
||||||
|
version={{VERSION}}
|
||||||
|
author={{AUTHOR}}
|
||||||
|
email={{EMAIL}}
|
||||||
|
homepage=https://{{HOMEPAGE}}
|
||||||
|
tracker=https://{{TRACKER}}/issues
|
||||||
|
repository=https://{{REPOSITORY}}
|
||||||
|
experimental={{EXPERIMENTAL}}
|
||||||
|
deprecated={{DEPRECATED}}
|
||||||
|
supportsQt6={{QT6}}
|
||||||
Reference in New Issue
Block a user