feat: PR builds

This commit is contained in:
Eli Bosley
2024-10-24 13:23:04 -04:00
parent 3da701a53b
commit eb38eb219e

View File

@@ -171,6 +171,45 @@ jobs:
retention-days: 5
if-no-files-found: error
release-pull-request:
if: |
github.event_name == 'pull_request' &&
github.event.action == 'opened' &&
github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
needs: [build-plugin]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Make PR Release Folder
run: mkdir pr-release/
- name: Download unraid-api binary tgz
uses: actions/download-artifact@v4
with:
name: unraid-api
path: pr-release
- name: Download plugin binary tgz
uses: actions/download-artifact@v4
with:
name: connect-files
- name: Upload to Cloudflare
uses: jakejarvis/s3-sync-action@v0.5.1
env:
AWS_S3_ENDPOINT: ${{ secrets.CF_ENDPOINT }}
AWS_S3_BUCKET: ${{ secrets.CF_BUCKET_PREVIEW }}
AWS_ACCESS_KEY_ID: ${{ secrets.CF_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_SECRET_ACCESS_KEY }}
AWS_REGION: "auto"
SOURCE_DIR: pr-release
DEST_DIR: unraid-api/${{ github.event.pull_request.number }}
- name: Print Path to Plugin Install
run: |
echo "Use the following URL to install the plugin on your Unraid server"
echo "https://${{ secrets.CF_BUCKET_PREVIEW }}.${{ secrets.CF_ENDPOINT }}/unraid-api/${{ github.event.pull_request.number }}/dynamix.unraid.net.staging.txz"
release-staging:
environment:
name: staging