Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
add webp script
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Sep 26, 2023
1 parent 435ef5f commit 87f2bcd
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#/bin/sh
set -e
PACKAGE=libwebp

# Update
pacman -Sy
OUTPUT=$(mktemp -d)

pkgs=$(echo mingw-w64-{i686,x86_64}-${PACKAGE})
URLS=$(pacman -Sp $pkgs --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: $FILE"
echo " - $FILE" >> readme.md
tar xf $FILE -C ${OUTPUT}
unlink $FILE
done
rm -Rf lib
mkdir -p lib
cp -Rf ${OUTPUT}/mingw64/include .
cp -Rf ${OUTPUT}/mingw64/lib lib/x64
cp -Rf ${OUTPUT}/mingw32/lib lib/i386
ls -ltrRh .
30 changes: 30 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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 '[email protected]'
git config --global user.name 'Jeroen Ooms (via CI)'
- uses: actions/checkout@v3
- uses: r-windows/install-rtools@master
- 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

0 comments on commit 87f2bcd

Please sign in to comment.