From c1b74607a727ac4fcf85e94b98b1fd4b7c4734ec Mon Sep 17 00:00:00 2001 From: AG_QGIS <> Date: Fri, 19 Jun 2026 13:51:13 +0200 Subject: [PATCH] Initial commit --- .gitea/templates/metadata.template | 13 +++ .gitea/workflows/release.yaml | 133 +++++++++++++++++++++++++++++ README.md | 0 changelog.txt | 2 + 4 files changed, 148 insertions(+) create mode 100644 .gitea/templates/metadata.template create mode 100644 .gitea/workflows/release.yaml create mode 100644 README.md create mode 100644 changelog.txt diff --git a/.gitea/templates/metadata.template b/.gitea/templates/metadata.template new file mode 100644 index 0000000..3abf72a --- /dev/null +++ b/.gitea/templates/metadata.template @@ -0,0 +1,13 @@ +[general] +version= +name=LNO Sachsen | Neu +description=Plugin zum Erzeugen ... +author=Daniel Helbig, Michael Otto +homepage=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_SN_Neu +tracker=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_SN_Neu/issues +repository=https://entwicklung.flurneuordnung-sachsen.de/AG_QGIS/Plugin_SN_Neu/src/branch/unstable/ +QGISMaximumVersion=4.99 +qgisMinimumVersion=3.40 +experimental=true +deprecated=false +supportsQt6=true \ No newline at end of file diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..bc3660e --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,133 @@ +name: Release Plugin +run-name: "Release | ${{ github.ref_name }}" + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: alpine-latest + defaults: + run: + shell: bash + + steps: + - name: Notwendige Abhängigkeiten installieren + shell: sh + run: | + apk add --no-cache bash git jq curl + + - name: Code holen + run: | + REPO_URL="https://${RELEASE_TOKEN}:x-oauth-basic@${{ vars.RELEASE_URL }}/${GITHUB_REPOSITORY}.git" + + git clone "$REPO_URL" repo + cd repo + + git checkout "$TAG" + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + TAG: "${{ github.ref_name }}" + + - name: Version und Kanal bestimmen + id: releaseinfo + run: | + TAG="${{ github.ref_name }}" + RAW_VERSION="${TAG#v}" + VERSION="${RAW_VERSION%%-*}" + + # Channel und Suffix automatisch bestimmen anhand des Tag-Suffix + case "$RAW_VERSION" in + *-testing*|*-t|*-T) + CHANNEL="testing" + PRERELEASE="true" + SUFFIX="-testing" + ;; + *-unstable*|*-u|*-U) + CHANNEL="unstable" + PRERELEASE="true" + SUFFIX="-unstable" + ;; + *) + CHANNEL="stable" + PRERELEASE="false" + SUFFIX="" + ;; + esac + + # Output setzen + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "channel=$CHANNEL" >> $GITHUB_OUTPUT + echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT + + # Optional Debug + echo "VERSION=$VERSION" + echo "CHANNEL=$CHANNEL" + echo "PRERELEASE=$PRERELEASE" + + # - name: plugin.cfg einlesen + # id: config + # run: | + # cd repo + # while read -r line || [ -n "$line" ]; do + # key="${line%%=*}" + # value="${line#*=}" + # echo "$key=$value" >> $GITHUB_OUTPUT + # done < plugin.cfg + + - name: Payload erzeugen + id: payload + run: | + cd repo + + NAME="${GITHUB_REPOSITORY##*/}" + GROUP="${GITHUB_REPOSITORY%%/*}" + VERSION="${{ steps.releaseinfo.outputs.version }}" + CHANNEL="${{ steps.releaseinfo.outputs.channel }}" + PRERELEASE="${{ steps.releaseinfo.outputs.prerelease }}" + ZIP_FOLDER="${{ vars.ZIP_FOLDER }}" + ZIP_FILE="${ZIP_FOLDER}.zip" + TAG="${{ github.ref_name }}" + #GIT_URL=${GITHUB_REPOSITORY} + + jq -n \ + --arg name "$NAME" \ + --arg group "$GROUP" \ + --arg version "$VERSION" \ + --arg channel "$CHANNEL" \ + --arg prerelease "$PRERELEASE" \ + --arg zip_folder "$ZIP_FOLDER" \ + --arg zip_file "$ZIP_FILE" \ + --arg tag "$TAG" \ + '{ + name: $name, + group: $group, + version: $version, + channel: $channel, + prerelease: ($prerelease == "true"), + zip_folder: $zip_folder, + zip_file: $zip_file, + tag: $tag + }' > payload.json + + cat payload.json + + - name: Repository aktualisieren + run: | + NAME="${GITHUB_REPOSITORY##*/}" + TAG="${{ steps.releaseinfo.outputs.version }}"-"${{ steps.releaseinfo.outputs.channel }}" + PAYLOAD_B64=$(base64 -w0 repo/payload.json) + + JSON="{\"ref\":\"hidden/workflows\",\"inputs\":{\"payload\":\"$PAYLOAD_B64\",\"name\":\"$NAME\",\"tag\":\"$TAG\"}}" + curl -X POST \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "$JSON" \ + "https://${{ vars.RELEASE_URL }}/api/v1/repos/${OWNER}/Repository/actions/workflows/${WORKFLOW}/dispatches" + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + OWNER: "AG_QGIS" + WORKFLOW: "release.yaml" + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..735d25d --- /dev/null +++ b/changelog.txt @@ -0,0 +1,2 @@ +--- +Erste Version \ No newline at end of file