Create ffmpeg Release #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
# push: | |
# branches: [master] | |
workflow_dispatch: | |
pull_request: | |
branches: [master] | |
name: Create ffmpeg Release | |
jobs: | |
build: | |
name: compile github ffmpeg then deploy | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Read Tag Version | |
run: | | |
# https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything | |
# git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs > constants.env | |
# git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs > constants.env | |
d=$(TZ=UTC-8 date +'%y%m%d%H%M%S') | |
grep GIT_FFMPEG_VERSION= ./init-cfgs/ffmpeg | awk -F = '{printf "RELEASE_VERSION=%s",$2}' | xargs > constants.env | |
echo "RELEASE_DATE=$d" >> constants.env | |
cat constants.env | |
- name: Export Env | |
uses: cardinalby/export-env-action@v2 | |
with: | |
envFile: 'constants.env' | |
- run: | | |
# export SKIP_FFMPEG_PATHCHES=1 | |
./init-any.sh all ffmpeg | |
./install-pre-any.sh all 'openssl opus bluray dav1d' | |
- name: generate src log | |
run: | | |
cd build/src/macos | |
ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../macos-src-log.md | |
cd ../ios | |
ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../ios-src-log.md | |
- name: do compile macos platform | |
run: | | |
./macos/compile-any.sh build ffmpeg | |
./macos/compile-any.sh lipo ffmpeg | |
- name: do compile ios platform | |
run: | | |
./ios/compile-any.sh build ffmpeg | |
./ios/compile-any.sh lipo ffmpeg | |
- name: Zip macos ffmpeg | |
run: | | |
cd build/product/macos/universal | |
zip -rq macos-universal.zip ./ffmpeg/* | |
- name: Zip ios ffmpeg | |
run: | | |
cd build/product/ios/universal | |
zip -rq ios-universal.zip ./ffmpeg/* | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ffmpeg-${{ env.RELEASE_VERSION }}-${{ env.RELEASE_DATE }} | |
release_name: ffmpeg-${{ env.RELEASE_VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload macos Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
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 | |
asset_path: build/product/macos/universal/macos-universal.zip | |
asset_name: "ffmpeg-macos-universal-${{ env.RELEASE_VERSION }}.zip" | |
asset_content_type: application/zip | |
- name: Upload ios Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
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 | |
asset_path: build/product/ios/universal/ios-universal.zip | |
asset_name: "ffmpeg-ios-universal-${{ env.RELEASE_VERSION }}.zip" | |
asset_content_type: application/zip | |
- name: Upload macos src md | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
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 | |
asset_path: build/src/macos-src-log.md | |
asset_name: "macos-src-log-${{ env.RELEASE_VERSION }}.md" | |
asset_content_type: application/text | |
- name: Upload ios src md | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
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 | |
asset_path: build/src/ios-src-log.md | |
asset_name: "ios-src-log-${{ env.RELEASE_VERSION }}.md" | |
asset_content_type: application/text |