fix: Correctly set BASE_URL for unstable build artifacts in GitHub Actions workflow

This commit is contained in:
Janez T
2025-10-22 12:21:11 +02:00
parent 5b6b606b0e
commit 2e8f4ed6e0
2 changed files with 5 additions and 3 deletions

2
.github/R2_SETUP.md vendored
View File

@@ -28,7 +28,7 @@ Configure these secrets in your GitHub repository settings (`Settings` → `Secr
| Secret Name | Description | Example | | Secret Name | Description | Example |
|-------------|-------------|---------| |-------------|-------------|---------|
| `R2_PUBLIC_URL` | Public URL for R2 bucket (if public access configured) | `https://builds.example.com` | | `R2_PUBLIC_URL` | Public URL for R2 bucket (if public access configured) | `https://meshcore-sar.dz0ny.dev` |
## Step-by-Step Setup ## Step-by-Step Setup

View File

@@ -843,12 +843,14 @@ jobs:
run: | run: |
# If R2_PUBLIC_URL is set, generate public download links # If R2_PUBLIC_URL is set, generate public download links
if [ -n "${{ secrets.R2_PUBLIC_URL }}" ]; then if [ -n "${{ secrets.R2_PUBLIC_URL }}" ]; then
BASE_URL="${{ secrets.R2_PUBLIC_URL }}/unstable/${{ steps.metadata.outputs.build_prefix }}"
echo "## 📦 Unstable Build Artifacts" >> $GITHUB_STEP_SUMMARY echo "## 📦 Unstable Build Artifacts" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY
echo "Build ID: \`${{ steps.metadata.outputs.build_prefix }}-${{ steps.metadata.outputs.timestamp }}\`" >> $GITHUB_STEP_SUMMARY echo "Build ID: \`${{ steps.metadata.outputs.build_prefix }}-${{ steps.metadata.outputs.timestamp }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY
echo "🌐 **[View Download Page]($BASE_URL/)**" >> $GITHUB_STEP_SUMMARY
BASE_URL="${{ secrets.R2_PUBLIC_URL }}/unstable/${{ steps.metadata.outputs.build_prefix }}" echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "r2-upload/unstable/${{ steps.metadata.outputs.build_prefix }}"/*.apk ]; then if [ -f "r2-upload/unstable/${{ steps.metadata.outputs.build_prefix }}"/*.apk ]; then
APK_FILE=$(basename r2-upload/unstable/${{ steps.metadata.outputs.build_prefix }}/*.apk) APK_FILE=$(basename r2-upload/unstable/${{ steps.metadata.outputs.build_prefix }}/*.apk)