Skip to content

Commit 40c6b29

Browse files
committed
add dvdread workflow
1 parent 0313e7c commit 40c6b29

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/dvdread.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
on:
2+
# push:
3+
# branches: [master]
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [master]
7+
8+
name: Create dvdread Release
9+
10+
jobs:
11+
build:
12+
name: compile dvdread then deploy
13+
runs-on: macos-13
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_REPO_VERSION= ./init-cfgs/dvdread | 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+
- name: init src
31+
run: ./init-any.sh all dvdread
32+
- name: generate src log
33+
run: |
34+
cd build/src/macos
35+
ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../macos-src-log.md
36+
cd ../ios
37+
ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../ios-src-log.md
38+
- name: do compile macos libs
39+
run: |
40+
cd macos
41+
./compile-any.sh build dvdread
42+
./compile-any.sh lipo dvdread
43+
- name: do compile ios libs
44+
run: |
45+
cd ios
46+
./compile-any.sh build dvdread
47+
./compile-any.sh lipo dvdread
48+
- name: Zip macos libs
49+
run: |
50+
cd build/product/macos/universal
51+
zip -rq macos-universal.zip ./*
52+
- name: Zip ios libs
53+
run: |
54+
cd build/product/ios/universal
55+
zip -rq ios-universal.zip ./*
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: dvdread-${{ env.RELEASE_VERSION }}-${{ env.RELEASE_DATE }}
63+
release_name: dvdread-${{ 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: "dvdread-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: "dvdread-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

Comments
 (0)