3
0

Workflow Update geäbdert, erster Test

This commit is contained in:
Michael Otto
2026-03-03 09:35:45 +01:00
parent 9784361a39
commit 8d4d1239a6
2 changed files with 26 additions and 48 deletions

View File

@@ -1,48 +0,0 @@
name: Update plugins.xml
on:
repository_dispatch:
types: [plugin-released]
jobs:
update:
runs-on: alpine-latest
steps:
- uses: actions/checkout@v3
with:
ref: feature/release
token: ${{ secrets.GITEA_TOKEN }}
- name: Select target XML file
id: target
run: |
case "${{ github.event.client_payload.channel }}" in
stable) echo "file=plugins.xml" >> $GITHUB_OUTPUT ;;
beta) echo "file=plugins-beta.xml" >> $GITHUB_OUTPUT ;;
dev) echo "file=plugins-dev.xml" >> $GITHUB_OUTPUT ;;
esac
- name: Remove existing entry for this plugin
run: |
PLUGIN="${{ github.event.client_payload.plugin }}"
FILE="${{ steps.target.outputs.file }}"
sed -i "/<pyqgis_plugin name=\"${PLUGIN}\"/,/<\/pyqgis_plugin>/d" "$FILE"
- name: Insert new XML block
run: |
FILE="${{ steps.target.outputs.file }}"
BLOCK=$(printf '${{ github.event.client_payload.xml_block }}' | sed 's/\\n/\n/g')
sed -i "s|</plugins>|${BLOCK}\n</plugins>|" "$FILE"
- name: Commit and push
env:
GITEA_URL: ${{ vars.GITEA_URL }}
run: |
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
git remote set-url origin \
https://oauth2:${{ secrets.GITEA_TOKEN }}@${GITEA_URL#https://}/${{ github.repository }}.git
git add plugins.xml plugins-beta.xml plugins-dev.xml
git commit -m "[${{ github.event.client_payload.channel }}] ${{ github.event.client_payload.plugin }}" \
|| echo "Keine Änderungen"
git push origin feature/release

View File

@@ -0,0 +1,26 @@
name: Test Payload Empfang (Alpine)
on:
repository_dispatch:
types: [update_plugin]
jobs:
show-payload:
runs-on: alpine-latest
steps:
- name: Payload anzeigen
run: |
echo "Payload empfangen:"
echo "--------------------------------"
echo "Plugin: ${{ github.event.client_payload.plugin }}"
echo "Version: ${{ github.event.client_payload.version }}"
echo "Channel: ${{ github.event.client_payload.channel }}"
echo "Description: ${{ github.event.client_payload.description }}"
echo "Author: ${{ github.event.client_payload.author }}"
echo "Email: ${{ github.event.client_payload.email }}"
echo "URL: ${{ github.event.client_payload.url }}"
echo "Changelog:"
echo "--------------------------------"
echo "${{ github.event.client_payload.changelog }}"
echo "--------------------------------"