This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#/bin/sh | ||
set -e | ||
PACKAGE=ffmpeg | ||
|
||
# Update | ||
pacman -Syy --noconfirm | ||
OUTPUT=$(mktemp -d) | ||
|
||
# Download files (-dd skips dependencies) | ||
pkgs=$(echo mingw-w64-{i686,x86_64,ucrt-x86_64}-${PACKAGE}) | ||
deps=$(pacman -Si $pkgs | grep 'Depends On' | grep -o 'mingw-w64-[_.a-z0-9-]*') | ||
URLS=$(pacman -Sp $pkgs $deps --cache=$OUTPUT) | ||
VERSION=$(pacman -Si mingw-w64-x86_64-${PACKAGE} | awk '/^Version/{print $3}') | ||
|
||
# Set version for next step | ||
echo "::set-output name=VERSION::${VERSION}" | ||
echo "::set-output name=PACKAGE::${PACKAGE}" | ||
echo "Bundling $PACKAGE-$VERSION" | ||
echo "# $PACKAGE $VERSION" > README.md | ||
echo "" >> README.md | ||
|
||
for URL in $URLS; do | ||
curl -OLs $URL | ||
FILE=$(basename $URL) | ||
echo "Extracting: $URL" | ||
echo " - $FILE" >> README.md | ||
tar xf $FILE -C ${OUTPUT} | ||
rm -f $FILE | ||
done | ||
|
||
# Copy libs | ||
rm -Rf include lib* | ||
mkdir -p lib/x64 lib-8.3.0/{x64,i386} | ||
cp -v ${OUTPUT}/ucrt64/lib/*.a lib/x64/ | ||
cp -v ${OUTPUT}/mingw64/lib/*.a lib-8.3.0/x64/ | ||
cp -v ${OUTPUT}/mingw32/lib/*.a lib-8.3.0/i386/ | ||
cp -rv ${OUTPUT}/ucrt64/include . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: bundle binaries | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Prepare git | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global user.email '121622595+jeroen[bot]@users.noreply.github.com' | ||
git config --global user.name 'Jeroen (via CI)' | ||
- uses: actions/checkout@v3 | ||
- id: download | ||
name: Download libraries | ||
run: | | ||
cd $(cygpath ${GITHUB_WORKSPACE}) | ||
.github/workflows/bundle.sh | ||
shell: c:\rtools40\usr\bin\bash.exe --login {0} | ||
- name: Push binaries | ||
run: | | ||
version=${{ steps.download.outputs.VERSION }} | ||
git add README.md include lib* | ||
git commit -m "Bundle $version ($(date +%F))" || exit 0 | ||
git tag $version | ||
git push origin master $version | ||
shell: bash |