manual-update-webinstaller.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This updates the Web Installer with the files from the webinstaller folder and the binary of the latest release
  2. # it only gets run on:
  3. # - Manually triggered
  4. # Make sure to also update the lower part of build.yml!
  5. name: Manual Web Installer Update
  6. on:
  7. workflow_dispatch: # Run on manual trigger
  8. # push:
  9. # branches:
  10. # - rolling
  11. # paths:
  12. # - webinstaller # The path filter somehow does not work, so lets run it on every change to rolling
  13. jobs:
  14. manually-update-web-installer:
  15. environment:
  16. name: github-pages
  17. url: ${{ steps.deployment.outputs.page_url }}
  18. runs-on: ubuntu-latest
  19. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  20. permissions:
  21. contents: read
  22. pages: write
  23. id-token: write
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@v3
  27. - name: Get version of last release
  28. id: last_release
  29. uses: joutvhu/get-release@v1
  30. with:
  31. latest: true
  32. prerelease: false
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. - name: Add binary to Web Installer and update manifest
  36. run: |
  37. echo "Updating Web installer to use firmware from ${{ steps.last_release.outputs.tag_name }}..."
  38. rm -f webinstaller/binary/firmware.bin
  39. wget ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.last_release.outputs.tag_name }}/AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
  40. unzip AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
  41. cp -f firmware.bin webinstaller/binary/firmware.bin
  42. echo "Updating index and manifest file..."
  43. sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' webinstaller/index.html
  44. sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' webinstaller/manifest.json
  45. - name: Setup Pages
  46. uses: actions/configure-pages@v5
  47. - name: Upload artifact
  48. uses: actions/upload-pages-artifact@v3
  49. with:
  50. path: 'webinstaller'
  51. - name: Deploy to GitHub Pages
  52. id: deployment
  53. uses: actions/deploy-pages@v4