fix: add npm cache, fix release asset upload flow
Build & Release / build-linux-win (push) Failing after 7m49s

This commit is contained in:
plenarius
2026-04-21 12:30:57 -04:00
parent ed200713df
commit 026b4d1e15
+19 -20
View File
@@ -16,6 +16,7 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "20"
cache: "npm"
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
@@ -30,33 +31,31 @@ jobs:
apt-get install -y --no-install-recommends wine64 wine32 apt-get install -y --no-install-recommends wine64 wine32
- name: Build Linux AppImage - name: Build Linux AppImage
run: npx electron-builder --linux run: npx electron-builder --linux --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Windows Installer - name: Build Windows Installer
run: npx electron-builder --win run: npx electron-builder --win --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to Gitea Release - name: Create Gitea Release and upload assets
uses: actions/upload-artifact@v4
with:
name: installers
path: |
release/*.exe
release/*.AppImage
release/*.yml
- name: Create Gitea Release
run: | run: |
TAG="${GITHUB_REF#refs/tags/}" TAG="${GITHUB_REF#refs/tags/}"
RELEASE=$(curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
-d "{\"tag_name\": \"${TAG}\", \"name\": \"Layonara Forge ${TAG}\", \"draft\": false, \"prerelease\": false}")
RELEASE_ID=$(echo "$RELEASE" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
for file in release/*.exe release/*.AppImage release/latest*.yml; do for file in release/*.exe release/*.AppImage release/latest*.yml; do
[ -f "$file" ] || continue [ -f "$file" ] || continue
curl -X POST \ BASENAME=$(basename "$file")
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ echo "Uploading $BASENAME..."
-F "attachment=@${file}" \ curl -s -X POST \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/${TAG}/assets" -H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${file};filename=${BASENAME}" \
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets"
done done
env: env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }} GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}