|
| 1 | +name: Update Amazon IVS Player SDK |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * *' # Run daily at midnight UTC |
| 6 | + workflow_dispatch: # Allow manual triggering |
| 7 | + |
| 8 | +jobs: |
| 9 | + update-ivs-player: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: write |
| 13 | + pull-requests: write |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Check for updates |
| 18 | + id: check-updates |
| 19 | + run: | |
| 20 | + # Extract current version from VideoPlayer.jsx |
| 21 | + CURRENT_VERSION=$(grep -oP 'player\.live-video\.net/\K[0-9]+\.[0-9]+\.[0-9]+' web-ui/src/components/videoPlayer/VideoPlayer.jsx) |
| 22 | + echo "Current version: $CURRENT_VERSION" |
| 23 | +
|
| 24 | + # Get latest version from npm |
| 25 | + LATEST_VERSION=$(npm view amazon-ivs-player version) |
| 26 | + echo "Latest version: $LATEST_VERSION" |
| 27 | +
|
| 28 | + # Compare versions |
| 29 | + if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then |
| 30 | + echo "Update available: $CURRENT_VERSION -> $LATEST_VERSION" |
| 31 | + echo "has_update=true" >> $GITHUB_OUTPUT |
| 32 | + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT |
| 33 | + echo "new_version=$LATEST_VERSION" >> $GITHUB_OUTPUT |
| 34 | + |
| 35 | + # Update the script src in VideoPlayer.jsx |
| 36 | + sed -i "s|player\.live-video\.net/$CURRENT_VERSION|player.live-video.net/$LATEST_VERSION|g" web-ui/src/components/videoPlayer/VideoPlayer.jsx |
| 37 | + else |
| 38 | + echo "No update available" |
| 39 | + echo "has_update=false" >> $GITHUB_OUTPUT |
| 40 | + fi |
| 41 | +
|
| 42 | + - name: Create Pull Request |
| 43 | + if: steps.check-updates.outputs.has_update == 'true' |
| 44 | + uses: peter-evans/create-pull-request@v6 |
| 45 | + with: |
| 46 | + commit-message: 'chore: update Amazon IVS Player SDK to ${{ steps.check-updates.outputs.new_version }}' |
| 47 | + title: 'chore: update Amazon IVS Player SDK to ${{ steps.check-updates.outputs.new_version }}' |
| 48 | + body: | |
| 49 | + This PR updates the Amazon IVS Player SDK from ${{ steps.check-updates.outputs.current_version }} to ${{ steps.check-updates.outputs.new_version }}. |
| 50 | +
|
| 51 | + The script source in `web-ui/src/components/videoPlayer/VideoPlayer.jsx` has been updated to use the latest version from the CDN. |
| 52 | +
|
| 53 | + ## Changes |
| 54 | + - Updated CDN URL from version ${{ steps.check-updates.outputs.current_version }} to ${{ steps.check-updates.outputs.new_version }} |
| 55 | +
|
| 56 | + This update was automatically generated by the dependency update workflow. |
| 57 | + branch: dependency-update/amazon-ivs-player |
| 58 | + delete-branch: true |
| 59 | + labels: | |
| 60 | + dependencies |
| 61 | + automated |
0 commit comments