1
1
name : MPV
2
2
3
3
on :
4
- workflow_dispatch :
5
4
# schedule:
6
5
# - cron: '0 8 * * */4'
6
+ workflow_dispatch :
7
+ inputs :
8
+ clean :
9
+ description : ' input anything if you want to clean build files'
10
+ required : false
11
+ cache_id :
12
+ description : ' input cache_id if you want to renew cache'
13
+ required : false
14
+ release :
15
+ description : " input 'false' if you don't want to release"
16
+ required : false
17
+ default : " true"
7
18
8
19
jobs :
9
20
build_mpv :
@@ -21,51 +32,65 @@ jobs:
21
32
uses : mego22/actions-git-sha@main
22
33
with :
23
34
repo : " https://github.com/mpv-player/mpv.git"
24
- - name : ' Get winbuild latest commit sha'
25
- id : build_sha
26
- uses : mego22/actions-git-sha@main
27
- with :
28
- repo : " https://github.com/shinchiro/mpv-winbuild-cmake.git"
29
35
- name : Get current time
30
36
run : |
31
- echo "long_time=$(date "+%Y-%m-%d %H:%M")" >> $GITHUB_ENV
32
37
echo "short_time=$(date "+%Y-%m-%d")" >> $GITHUB_ENV
33
38
echo "month=$(date "+%Y-%m")" >> $GITHUB_ENV
34
- echo "sha=$(expr substr "${{ steps.get_sha.outputs.sha }}" 1 7)" >> $GITHUB_ENV
35
39
36
40
- name : Cache
37
41
uses : actions/cache@v2
38
42
with :
39
43
path : mpv-winbuild-cmake/build${{ matrix.bit }}
40
- key : ${{ runner.os }}-mpv-build${{ matrix.bit }}-${{ env.month }}-${{ steps.build_sha .outputs.sha }}-${{ env.short_time }}
44
+ key : ${{ runner.os }}-mpv-build${{ matrix.bit }}-${{ env.short_time }}-${{ steps.get_sha .outputs.sha }}-${{ github.event.inputs.cache_id }}
41
45
restore-keys : |
42
- ${{ runner.os }}-mpv-build${{ matrix.bit }}-${{ env.month }}-${{ steps.build_sha.outputs.sha }}
46
+ ${{ runner.os }}-mpv-build${{ matrix.bit }}-${{ env.short_time }}-${{ steps.get_sha.outputs.sha }}
47
+ ${{ runner.os }}-mpv-build${{ matrix.bit }}-${{ env.short_time }}
43
48
${{ runner.os }}-mpv-build${{ matrix.bit }}-${{ env.month }}
44
-
45
49
- name : Build
46
50
shell : bash
47
51
run : |
48
- sudo bash build.sh "${{ matrix.bit }}"
49
- # - name: upload logs
50
- # uses: actions/upload-artifact@master
51
- # with:
52
- # name: logs
53
- # path: |
54
- # mpv-winbuild-cmake/build64/packages/mpv-prefix/src/mpv-stamp/mpv-build-*.log
55
- # mpv-winbuild-cmake/build64/packages/mujs-prefix/src/mujs-stamp/mujs-build-*.log
56
- # mpv-winbuild-cmake/build64/packages/libsrt-prefix/src/libsrt-stamp/libsrt-configure-*.log
52
+ sudo bash build.sh "${{ matrix.bit }}" "${{ github.event.inputs.clean }}"
53
+ # - name: upload logs
54
+ # uses: actions/upload-artifact@master
55
+ # if: always()
56
+ # with:
57
+ # name: logs
58
+ # path: |
59
+ # mpv-winbuild-cmake/build64/packages/mpv-prefix/src/mpv-stamp/mpv-*.log
57
60
58
61
- name : Upload artifact
59
62
id : upload
60
63
uses : kittaakos/upload-artifact-as-is@master
61
64
with :
62
65
path : mpv-winbuild-cmake/release/*.7z
63
66
67
+ publish_release :
68
+ name : Publish release
69
+ needs : build_mpv
70
+ if : ${{ github.event.inputs.release }} != "false"
71
+ runs-on : ubuntu-latest
72
+
73
+ steps :
74
+ - name : Checkout
75
+ uses : actions/checkout@v2
76
+ - name : Download artifacts
77
+ uses : actions/download-artifact@v2
78
+ with :
79
+ path : artifacts
80
+
81
+ - name : ' Get mpv latest commit sha'
82
+ id : get_sha
83
+ uses : mego22/actions-git-sha@main
84
+ with :
85
+ repo : " https://github.com/mpv-player/mpv.git"
86
+ - name : Get current time
87
+ run : |
88
+ echo "long_time=$(date "+%Y-%m-%d %H:%M")" >> $GITHUB_ENV
89
+ echo "short_time=$(date "+%Y-%m-%d")" >> $GITHUB_ENV
64
90
- name : Create release
65
91
uses : ncipollo/release-action@v1
66
- if : ${{ steps.upload.outcome == 'success' }}
67
92
with :
68
- artifacts : " mpv-winbuild-cmake/release /*.7z"
93
+ artifacts : " artifacts/* /*.7z"
69
94
commit : main
70
95
name : " MPV ${{ env.long_time }}"
71
96
body : " MPV git commit: https://github.com/mpv-player/mpv/commit/${{ steps.get_sha.outputs.sha }}\n Build Time: ${{ env.long_time }}"
78
103
run : |
79
104
sudo bash prunetags.sh
80
105
env :
81
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
106
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments