|
10 | 10 | description: 'Run custom command before building'
|
11 | 11 | required: false
|
12 | 12 | type: string
|
13 |
| - sourceforge: |
14 |
| - description: 'Upload to Sourceforge' |
15 |
| - required: false |
16 |
| - default: false |
17 |
| - type: boolean |
18 | 13 | github_release:
|
19 | 14 | description: 'Upload to Github release'
|
20 | 15 | required: false
|
@@ -121,11 +116,6 @@ jobs:
|
121 | 116 | ninja -C build_$BIT mpv-packaging; mv build_$BIT/mpv*.7z release_$BIT
|
122 | 117 | 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
|
123 | 118 |
|
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 |
| -
|
129 | 119 | - name: Collecting logs
|
130 | 120 | if: always()
|
131 | 121 | run: |
|
@@ -250,116 +240,22 @@ jobs:
|
250 | 240 | mv release_i686/* release_x86_64/* release_x86_64_v3/* release_aarch64/* release
|
251 | 241 | du -ah release/*
|
252 | 242 |
|
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 |
| -
|
277 | 243 | - name: Uploading packages to Github release
|
278 | 244 | id: upload_packages_gh
|
279 | 245 | if: ${{ github.event.inputs.github_release == 'true' && github.event.inputs.mpv_tarball == 'false' }}
|
280 | 246 | continue-on-error: true
|
281 | 247 | run: |
|
282 | 248 | short_date=$(date "+%Y%m%d")
|
283 | 249 | body=$(cat <<END
|
284 |
| -  |
285 |
| -
|
286 | 250 | **Workflow run**: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
|
287 | 251 | END
|
288 | 252 | )
|
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' |
290 | 254 | {
|
291 | 255 | "tag_name": "$short_date",
|
292 | 256 | "name": "$short_date",
|
293 | 257 | "body": "$(echo ${body//$'\n'/'\n'})"
|
294 | 258 | }
|
295 | 259 | END
|
296 | 260 | )
|
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