Skip to content

Commit 8cc51fa

Browse files
committed
build
1 parent 9c153bc commit 8cc51fa

16 files changed

+313
-1733
lines changed

.github/workflows/mpv_clang.yml

+2-106
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ on:
1010
description: 'Run custom command before building'
1111
required: false
1212
type: string
13-
sourceforge:
14-
description: 'Upload to Sourceforge'
15-
required: false
16-
default: false
17-
type: boolean
1813
github_release:
1914
description: 'Upload to Github release'
2015
required: false
@@ -121,11 +116,6 @@ jobs:
121116
ninja -C build_$BIT mpv-packaging; mv build_$BIT/mpv*.7z release_$BIT
122117
if [[ $BIT == x86_64_v3 ]]; then for dir in release_$BIT/mpv-*; do name=$(basename $dir); mv $dir $(dirname $dir)/${name/x86_64/x86_64-v3}; done; fi
123118
124-
- name: Copying ffmpeg
125-
run: |
126-
hash=$(git -C src_packages/ffmpeg rev-parse --short HEAD)
127-
7z a -m0=lzma2 -mx=9 -ms=on release_$BIT/ffmpeg-${{ env.arch }}${{ env.x86_64_level }}-git-$hash.7z ./build_$BIT/$BIT-w64-mingw32/bin/ffmpeg.exe
128-
129119
- name: Collecting logs
130120
if: always()
131121
run: |
@@ -250,116 +240,22 @@ jobs:
250240
mv release_i686/* release_x86_64/* release_x86_64_v3/* release_aarch64/* release
251241
du -ah release/*
252242
253-
- name: Uploading packages to Sourceforge
254-
id: upload_packages_sf
255-
if: ${{ github.event.inputs.sourceforge == 'true' }}
256-
continue-on-error: true
257-
env:
258-
MPV_VER: ${{ needs.build_mpv.outputs.mpv_ver }}
259-
run: |
260-
mkdir -p /root/.ssh/
261-
echo "${{ secrets.SF_PRIVATE_KEY }}" > sf_key
262-
pubkey=$(cat <<END
263-
frs.sourceforge.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQD35Ujalhh+JJkPvMckDlhu4dS7WH6NsOJ15iGCJLC
264-
END
265-
)
266-
echo $pubkey > /root/.ssh/known_hosts
267-
chmod 400 sf_key
268-
chmod -R 700 /root
269-
sftp -i sf_key [email protected]:/home/frs/project/mpv-player-windows <<END
270-
put release/mpv-dev* libmpv
271-
put release/mpv-i686* 32bit
272-
put release/mpv-x86_64-[!v3]* 64bit
273-
put release/mpv-x86_64-v3* 64bit-v3
274-
put release/mpv-$MPV_VER* release
275-
END
276-
277243
- name: Uploading packages to Github release
278244
id: upload_packages_gh
279245
if: ${{ github.event.inputs.github_release == 'true' && github.event.inputs.mpv_tarball == 'false' }}
280246
continue-on-error: true
281247
run: |
282248
short_date=$(date "+%Y%m%d")
283249
body=$(cat <<END
284-
![GitHub release (by tag)](https://img.shields.io/github/downloads/shinchiro/mpv-winbuild-cmake/$short_date/total?label=Downloads)
285-
286250
**Workflow run**: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
287251
END
288252
)
289-
id=$(curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases -d @- <<END | jq -r '.id'
253+
id=$(curl -u media-kit:$GH_TOKEN $CURL_RETRIES -s -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/media-kit/libmpv-win32-video-cmake/releases -d @- <<END | jq -r '.id'
290254
{
291255
"tag_name": "$short_date",
292256
"name": "$short_date",
293257
"body": "$(echo ${body//$'\n'/'\n'})"
294258
}
295259
END
296260
)
297-
for file in release/*.7z; do curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -X POST -H "Accept: application/vnd.github.v3+json" -H "Content-Type: $(file -b --mime-type $file)" https://uploads.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/$id/assets?name=$(basename $file) --data-binary @$file; done
298-
299-
- name: Pruning tags
300-
continue-on-error: true
301-
run: |
302-
# Keep latest 30 tags/releases
303-
git fetch --tags
304-
tag_list=($(git tag | sort -r))
305-
old=${tag_list[@]:30}
306-
for tag in ${old[@]}; do
307-
id=$(curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -X GET -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/tags/$tag | jq -r '.id')
308-
curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -X DELETE -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/$id
309-
git tag -d $tag
310-
done
311-
git push --tags --prune https://shinchiro:[email protected]/shinchiro/mpv-winbuild-cmake
312-
313-
- name: Delete releases cache
314-
if: ${{ github.event.inputs.github_release == 'false' || steps.upload_packages_gh.outcome == 'success' }}
315-
run: |
316-
curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -o /dev/null -X DELETE -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/actions/caches?key=$release_i686_key
317-
curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -o /dev/null -X DELETE -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/actions/caches?key=$release_x86_64_key
318-
curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -o /dev/null -X DELETE -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/actions/caches?key=$release_x86_64_v3_key
319-
curl -u shinchiro:$GH_TOKEN $CURL_RETRIES -s -o /dev/null -X DELETE -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/actions/caches?key=$release_aarch64_key
320-
321-
call_workflow:
322-
name: Run mpv_gcc
323-
runs-on: ubuntu-latest
324-
needs: build_mpv
325-
env:
326-
GH_TOKEN: ${{ github.token }}
327-
GH_COMMAND: ${{ github.event.inputs.command }}
328-
steps:
329-
- name: Run mpv_gcc.yml
330-
run: |
331-
curl -u shinchiro:$GH_TOKEN -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/actions/workflows/mpv_gcc.yml/dispatches -d @- <<EOF
332-
{
333-
"ref": "master",
334-
"inputs": {
335-
"sourceforge": "false",
336-
"github_release": "true",
337-
"mpv_tarball": "false",
338-
"command": "$GH_COMMAND"
339-
}
340-
}
341-
EOF
342-
343-
gist:
344-
name: Gist
345-
runs-on: ubuntu-latest
346-
needs: build_mpv
347-
if: ${{ always() }}
348-
env:
349-
GH_TOKEN: ${{ secrets.GIST_TOKEN }}
350-
RUN_ID: ${{ github.run_id }}
351-
steps:
352-
- name: Setup git credentials
353-
run: |
354-
git config --global user.name "github-actions"
355-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
356-
357-
- name: Upload job logs to gist
358-
run: |
359-
url=$(curl -su shinchiro:$GH_TOKEN -X GET -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/actions/runs/$RUN_ID/jobs | jq -r '.jobs[0] | .url')
360-
curl -sLu shinchiro:$GH_TOKEN -X GET -H "Accept: application/vnd.github.v3+json" $url/logs -o mpv_log
361-
git clone --depth 1 https://shinchiro:[email protected]/90308c6632c9010d03b325c9ca6a4b6f job_log
362-
cp -f mpv_log job_log/mpv_log
363-
git -C job_log add .
364-
git -C job_log commit --amend --no-edit
365-
git -C job_log push -f https://shinchiro:[email protected]/90308c6632c9010d03b325c9ca6a4b6f
261+
for file in release/*.7z; do curl -u media-kit:$GH_TOKEN $CURL_RETRIES -X POST -H "Accept: application/vnd.github.v3+json" -H "Content-Type: $(file -b --mime-type $file)" https://uploads.github.com/repos/media-kit/libmpv-win32-video-cmake/releases/$id/assets?name=$(basename $file) --data-binary @$file; done

0 commit comments

Comments
 (0)