create-new-release.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: Create new release
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. new_version:
  6. description: 'New version'
  7. required: true
  8. type: string
  9. ref:
  10. description: 'Commit hash (optional)'
  11. required: false
  12. default: ''
  13. type: string
  14. jobs:
  15. test-new-version:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Verify new version format
  19. run: |
  20. if [[ "${{ inputs.new_version }}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]];
  21. then
  22. echo "New version looks okay";
  23. else
  24. echo "Invalid version format";
  25. exit 1
  26. fi
  27. build:
  28. runs-on: ubuntu-latest
  29. env:
  30. FBT_NO_SYNC: "true"
  31. TARGETS: f7
  32. DEFAULT_TARGET: f7
  33. steps:
  34. - name: 'Decontaminate previous build leftovers'
  35. run: |
  36. if [ -d .git ]; then
  37. git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
  38. fi
  39. - uses: actions/checkout@v3
  40. with:
  41. ref: "${{inputs.ref}}"
  42. fetch-depth: 0
  43. submodules: 'recursive'
  44. - name: Build
  45. run: ./build.ps1
  46. shell: pwsh
  47. - uses: ncipollo/release-action@v1.12.0
  48. with:
  49. artifacts: "build/*.fap,build/checksums.sha256"
  50. bodyFile: ".github/release-body.md"
  51. artifactErrorsFailBuild: true
  52. updateOnlyUnreleased: true
  53. allowUpdates: true
  54. removeArtifacts: true
  55. draft: true
  56. tag: "v${{ inputs.new_version }}"
  57. commit: "${{inputs.ref}}"