Fix release workflow: replace actions/checkout with direct curl download
Release erstellen / build-release (push) Successful in 53s
Release erstellen / build-release (push) Successful in 53s
Runner cannot resolve internal 'gitea' hostname. Download source archive from external URL git.wende.it instead. Also replace release-action with direct Gitea API calls to avoid the same DNS issue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,8 +10,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Code auschecken
|
- name: Code herunterladen
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
VERSION="${{ github.ref_name }}"
|
||||||
|
curl -sSL -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-o source.tar.gz \
|
||||||
|
"https://git.wende.it/marco/WitShop/archive/${VERSION}.tar.gz"
|
||||||
|
tar xzf source.tar.gz
|
||||||
|
# Gitea entpackt in einen Unterordner WitShop-{version}/
|
||||||
|
SRCDIR=$(tar tzf source.tar.gz 2>/dev/null | head -1 | cut -d/ -f1 || true)
|
||||||
|
if [ -n "$SRCDIR" ] && [ -d "$SRCDIR" ]; then
|
||||||
|
mv "$SRCDIR"/* . 2>/dev/null || true
|
||||||
|
mv "$SRCDIR"/.[!.]* . 2>/dev/null || true
|
||||||
|
rmdir "$SRCDIR" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
rm -f source.tar.gz
|
||||||
|
|
||||||
- name: Node.js einrichten
|
- name: Node.js einrichten
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
@@ -51,19 +64,32 @@ jobs:
|
|||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Release in Gitea veröffentlichen
|
- name: Release in Gitea veröffentlichen
|
||||||
uses: https://gitea.com/actions/release-action@main
|
run: |
|
||||||
with:
|
# Release erstellen (oder existierenden verwenden)
|
||||||
files: ${{ env.PACKAGE }}
|
RELEASE_ID=$(curl -sSL -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
api_key: ${{ secrets.RELEASE_TOKEN }}
|
"https://git.wende.it/api/v1/repos/marco/WitShop/releases/tags/${{ github.ref_name }}" \
|
||||||
title: "WITshop ${{ env.VERSION }}"
|
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('id',''))" 2>/dev/null || true)
|
||||||
body: |
|
|
||||||
## WITshop ${{ env.VERSION }}
|
|
||||||
|
|
||||||
### Installation (Erstinstallation)
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
1. ZIP herunterladen und auf den Server entpacken
|
RELEASE_ID=$(curl -sSL -X POST \
|
||||||
2. `install.sh` ausführen: `bash install.sh`
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
3. Fertig
|
-H "Content-Type: application/json" \
|
||||||
|
"https://git.wende.it/api/v1/repos/marco/WitShop/releases" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"${{ github.ref_name }}\",
|
||||||
|
\"name\": \"WITshop ${{ github.ref_name }}\",
|
||||||
|
\"body\": \"## WITshop ${{ github.ref_name }}\n\n### Installation (Erstinstallation)\n1. ZIP herunterladen und auf den Server entpacken\n2. \`install.sh\` ausführen: \`bash install.sh\`\n3. Fertig\n\n### Update (bestehende Installation)\n1. ZIP herunterladen und auf den Server entpacken\n2. \`update.sh\` ausführen: \`bash update.sh\`\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
|
fi
|
||||||
|
|
||||||
### Update (bestehende Installation)
|
echo "Release ID: $RELEASE_ID"
|
||||||
1. ZIP herunterladen und auf den Server entpacken
|
|
||||||
2. `update.sh` ausführen: `bash update.sh`
|
# ZIP anhängen
|
||||||
|
curl -sSL -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-F "attachment=@${{ env.PACKAGE }}" \
|
||||||
|
"https://git.wende.it/api/v1/repos/marco/WitShop/releases/${RELEASE_ID}/assets?name=${{ env.PACKAGE }}"
|
||||||
|
|
||||||
|
echo "ZIP erfolgreich hochgeladen: ${{ env.PACKAGE }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user