Files
provisionsmanager95/.gitea/workflows/windows-build.yml
T

60 lines
2.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Baut die Windows-Version (Provisionsmanager95.exe) mit Windows-Python unter Wine.
# - jeder Push / PR: Tests + .exe als Build-Artefakt
# - Tag "v*" (z. B. v1.0.0): zusätzlich Gitea-Release mit .exe und .zip
name: Windows-Build
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
jobs:
windows-exe:
# Label ggf. an euren Runner anpassen (Runner braucht Docker; Wine steckt im Container-Image).
runs-on: ubuntu-latest
container:
image: tobix/pywine:3.12
env:
WINEPREFIX: /opt/wineprefix
steps:
- name: Werkzeuge für Checkout/Upload installieren
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends git nodejs ca-certificates >/dev/null
- uses: actions/checkout@v4
- name: Tests + Build (.exe)
run: ./build/build_windows.sh
- name: Build-Artefakt hochladen
uses: actions/upload-artifact@v3
with:
name: Provisionsmanager95
path: |
dist/Provisionsmanager95.exe
dist/Provisionsmanager95-*.zip
- name: Release erstellen
if: startsWith(github.ref, 'refs/tags/v')
env:
TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITEA_TOKEN }}
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -eu
VERSION=$(cat dist/VERSION | tr -d '\r\n')
if [ "v$VERSION" != "$TAG" ]; then
echo "Tag $TAG passt nicht zu provtool/__init__.py (Version $VERSION)"; exit 1
fi
resp=$(curl -sf -X POST "$API/releases" -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"Provisions-Manager 95 $TAG\",\"body\":\"Windows-Version $VERSION – einfach die .exe herunterladen und starten.\"}")
id=$(echo "$resp" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
for f in dist/Provisionsmanager95.exe dist/Provisionsmanager95-$VERSION.zip; do
curl -sf -X POST "$API/releases/$id/assets?name=$(basename "$f")" \
-H "Authorization: token $TOKEN" -F "attachment=@$f" >/dev/null
echo "hochgeladen: $f"
done