|
| 1 | +on: |
| 2 | + # push: |
| 3 | + # branches: [master] |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + branches: [master] |
| 7 | + |
| 8 | +name: Create ffmpeg Release |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: compile github ffmpeg then deploy |
| 13 | + runs-on: macos-latest |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v3 |
| 17 | + - name: Read Tag Version |
| 18 | + run: | |
| 19 | + # https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything |
| 20 | + # git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs > constants.env |
| 21 | + # git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs > constants.env |
| 22 | + d=$(TZ=UTC-8 date +'%y%m%d%H%M%S') |
| 23 | + grep GIT_FFMPEG_VERSION= ./init-cfgs/ffmpeg | awk -F = '{printf "RELEASE_VERSION=%s",$2}' | xargs > constants.env |
| 24 | + echo "RELEASE_DATE=$d" >> constants.env |
| 25 | + cat constants.env |
| 26 | + - name: Export Env |
| 27 | + uses: cardinalby/export-env-action@v2 |
| 28 | + with: |
| 29 | + envFile: 'constants.env' |
| 30 | + - run: | |
| 31 | + export SKIP_FFMPEG_PATHCHES=1 |
| 32 | + ./init-any.sh all ffmpeg |
| 33 | + ./install-pre-any.sh all 'libyuv openssl opus bluray dav1d' |
| 34 | + - name: generate src log |
| 35 | + run: | |
| 36 | + cd build/src/macos |
| 37 | + ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../macos-src-log.md |
| 38 | + cd ../ios |
| 39 | + ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../ios-src-log.md |
| 40 | + - name: do compile macos platform |
| 41 | + run: | |
| 42 | + ./macos/compile-any.sh build ffmpeg |
| 43 | + ./macos/compile-any.sh lipo ffmpeg |
| 44 | + - name: do compile ios platform |
| 45 | + run: | |
| 46 | + ./ios/compile-any.sh build ffmpeg |
| 47 | + ./ios/compile-any.sh lipo ffmpeg |
| 48 | + - name: Zip macos ffmpeg |
| 49 | + run: | |
| 50 | + cd build/product/macos/universal |
| 51 | + zip -rq macos-universal.zip ./ffmpeg/* |
| 52 | + - name: Zip ios ffmpeg |
| 53 | + run: | |
| 54 | + cd build/product/ios/universal |
| 55 | + zip -rq ios-universal.zip ./ffmpeg/* |
| 56 | + - name: Create Release |
| 57 | + id: create_release |
| 58 | + uses: actions/create-release@v1 |
| 59 | + env: |
| 60 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + with: |
| 62 | + tag_name: ffmpeg-${{ env.RELEASE_VERSION }}-${{ env.RELEASE_DATE }} |
| 63 | + release_name: ffmpeg-${{ env.RELEASE_VERSION }} |
| 64 | + draft: false |
| 65 | + prerelease: false |
| 66 | + - name: Upload macos Release Asset |
| 67 | + uses: actions/upload-release-asset@v1 |
| 68 | + env: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + with: |
| 71 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 72 | + asset_path: build/product/macos/universal/macos-universal.zip |
| 73 | + asset_name: "ffmpeg-macos-universal-${{ env.RELEASE_VERSION }}.zip" |
| 74 | + asset_content_type: application/zip |
| 75 | + - name: Upload ios Release Asset |
| 76 | + uses: actions/upload-release-asset@v1 |
| 77 | + env: |
| 78 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + with: |
| 80 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 81 | + asset_path: build/product/ios/universal/ios-universal.zip |
| 82 | + asset_name: "ffmpeg-ios-universal-${{ env.RELEASE_VERSION }}.zip" |
| 83 | + asset_content_type: application/zip |
| 84 | + - name: Upload macos src md |
| 85 | + uses: actions/upload-release-asset@v1 |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + with: |
| 89 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 90 | + asset_path: build/src/macos-src-log.md |
| 91 | + asset_name: "macos-src-log-${{ env.RELEASE_VERSION }}.md" |
| 92 | + asset_content_type: application/text |
| 93 | + - name: Upload ios src md |
| 94 | + uses: actions/upload-release-asset@v1 |
| 95 | + env: |
| 96 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 97 | + with: |
| 98 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 99 | + asset_path: build/src/ios-src-log.md |
| 100 | + asset_name: "ios-src-log-${{ env.RELEASE_VERSION }}.md" |
| 101 | + asset_content_type: application/text |
0 commit comments