name: Release SDSAT on: push: tags: - "v*.*.*" workflow_dispatch: jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install deps run: | python -m pip install -U pip pip install -e ".[dev]" - name: Lint + Tests run: | ruff check . pytest -q - name: Build SDSAT tar.gz with metadata (no __init__) run: | set -eux mkdir -p dist buildtmp/{bin,logs,update} # Copie uniquement le contenu de scripts/ dans buildtmp/bin cp -r scripts/. buildtmp/bin/ # Exclure __init__.py find buildtmp/bin -name "__init__.py" -delete # Metadata cat > buildtmp/update/BUILD_INFO.txt </tmp/release_create.json || true # Récupère l'id de la release par tag (fiable) curl -sS "${API}/repos/${OWNER}/${REPO}/releases/tags/${TAG}" \ -H "Authorization: token ${GITEA_TOKEN}" \ >/tmp/release_get.json RID=$(python -c "import json;print(json.load(open('/tmp/release_get.json'))['id'])") ASSET="dist/SDSAT-${TAG}.tar.gz" ls -la "${ASSET}" curl -sS -X POST "${API}/repos/${OWNER}/${REPO}/releases/${RID}/assets?name=$(basename "${ASSET}")" \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/gzip" \ --data-binary @"${ASSET}" \ >/dev/null