Skip to content

Commit 3911be3

Browse files
authored
chore: keep preview plg when merging release-please pr's (#1312)
prevents staging plugin from breaking due to being populated with prod entities ## Summary by CodeRabbit - **Chores** - Enhanced the deployment process to clearly distinguish between production and preview releases. - Added verification steps to ensure all required production assets are present, improving the overall reliability of plugin updates.
1 parent 1515385 commit 3911be3

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,20 @@ jobs:
385385
BUCKET_PATH="unraid-api"
386386
fi
387387
388+
# On release, build both prod and preview plugins
388389
if [ "${{ needs.release-please.outputs.releases_created }}" == 'true' ]; then
389390
BASE_URL="https://stable.dl.unraid.net/unraid-api"
390-
else
391-
BASE_URL="https://preview.dl.unraid.net/unraid-api"
391+
pnpm run build:plugin --tag="${TAG}" --base-url="${BASE_URL}"
392+
mv ./deploy ./deploy-prod
392393
fi
393394
395+
BASE_URL="https://preview.dl.unraid.net/unraid-api"
394396
echo "BUCKET_PATH=${BUCKET_PATH}" >> $GITHUB_OUTPUT
395397
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
396-
397398
pnpm run build:plugin --tag="${TAG}" --base-url="${BASE_URL}"
398399
- name: Ensure Plugin Files Exist
399400
run: |
401+
ls -al ./deploy
400402
if [ ! -f ./deploy/*.plg ]; then
401403
echo "Error: .plg file not found in plugin/deploy/"
402404
exit 1
@@ -406,7 +408,19 @@ jobs:
406408
echo "Error: .txz file not found in plugin/deploy/"
407409
exit 1
408410
fi
409-
ls -al ./deploy
411+
- name: Ensure Production Plugin Files Exist
412+
if: needs.release-please.outputs.releases_created == 'true'
413+
run: |
414+
ls -al ./deploy-prod
415+
if [ ! -f ./deploy-prod/*.plg ]; then
416+
echo "Error: .plg file not found in plugin/deploy-prod/"
417+
exit 1
418+
fi
419+
420+
if [ ! -f ./deploy-prod/*.txz ]; then
421+
echo "Error: .txz file not found in plugin/deploy-prod/"
422+
exit 1
423+
fi
410424
- name: Upload to GHA
411425
uses: actions/upload-artifact@v4
412426
with:
@@ -434,7 +448,7 @@ jobs:
434448
run: |
435449
release_name=$(gh release list --repo ${{ github.repository }} --json name,isDraft --jq '.[] | select(.isDraft == true) | .name' | head -n 1)
436450
# For each file in release directory
437-
for file in deploy/*; do
451+
for file in deploy-prod/*; do
438452
echo "Uploading $file to release..."
439453
gh release upload "${release_name}" "$file" --clobber
440454
done

0 commit comments

Comments
 (0)