Skip unavailable SourceForge mirror

This commit is contained in:
ushan0v
2026-07-14 06:42:19 +03:00
parent c1c913ba4d
commit 2a1c97b592
3 changed files with 32 additions and 0 deletions
+2
View File
@@ -7,6 +7,7 @@ on:
- 'forkop/Makefile'
- 'build.sh'
- 'tests/**'
- '.github/workflows/build.yml'
- '.github/workflows/backend-ci.yml'
push:
branches:
@@ -16,6 +17,7 @@ on:
- 'forkop/Makefile'
- 'build.sh'
- 'tests/**'
- '.github/workflows/build.yml'
- '.github/workflows/backend-ci.yml'
jobs:
+18
View File
@@ -245,7 +245,22 @@ jobs:
exit 1
fi
- name: Check SourceForge project
id: sourceforge
shell: bash
run: |
if sftp -i "$HOME/.ssh/sourceforge" -b - ushan0v@frs.sourceforge.net <<'EOF'
ls /home/frs/project/forkop
EOF
then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
echo "::warning::SourceForge project is unavailable; skipping mirror publication"
fi
- name: Upload SourceForge packages
if: ${{ steps.sourceforge.outputs.available == 'true' }}
shell: bash
env:
VERSION: ${{ needs.preparation.outputs.version }}
@@ -259,6 +274,7 @@ jobs:
EOF
- name: Verify SourceForge package downloads
if: ${{ steps.sourceforge.outputs.available == 'true' }}
shell: bash
env:
VERSION: ${{ needs.preparation.outputs.version }}
@@ -287,6 +303,7 @@ jobs:
done
- name: Publish SourceForge installer metadata
if: ${{ steps.sourceforge.outputs.available == 'true' }}
shell: bash
run: |
set -euo pipefail
@@ -301,6 +318,7 @@ jobs:
EOF
- name: Verify SourceForge installer metadata
if: ${{ steps.sourceforge.outputs.available == 'true' }}
shell: bash
env:
VERSION: ${{ needs.preparation.outputs.version }}
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail
workflow="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/.github/workflows/build.yml"
gate="if: \${{ steps.sourceforge.outputs.available == 'true' }}"
grep -Fq 'id: sourceforge' "$workflow"
grep -Fq 'ls /home/frs/project/forkop' "$workflow"
[ "$(grep -Fc "$gate" "$workflow")" -eq 4 ]
grep -Fq 'SourceForge project is unavailable; skipping mirror publication' "$workflow"
printf 'release workflow checks passed\n'