From 76f858eb54838535d6756334c52b47b82ae248b7 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Thu, 22 Dec 2022 16:06:49 +0000 Subject: [PATCH] Build action. --- .github/workflows/dist.yml | 14 +++++++++++--- .gitignore | 2 ++ build.sh | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 build.sh diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index b768a2c..4068c76 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -6,8 +6,16 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - - name: Placeholder - run: true \ No newline at end of file + - uses: actions/checkout@v4 + + - name: Build artifact + run: ./build.sh + shell: bash + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + path: dcraw-windows.zip \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a2a255 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build*/ +libjpeg-turbo*/ \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..61a07ae --- /dev/null +++ b/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -Eeuo pipefail + +JVER=3.0.1 +if [ ! -d "libjpeg-turbo-$JVER" ]; then + url="https://downloads.sourceforge.net/project/libjpeg-turbo/$JVER/libjpeg-turbo-$JVER-gcc64.exe" + mkdir "libjpeg-turbo-$JVER" + pushd "libjpeg-turbo-$JVER" + curl -sL "$url" > archive.7z + 7z x archive.7z + popd +fi + +gcc -O3 -o dcraw.exe dcraw.c -lws2_32 -DNO_JASPER -DNO_LCMS \ + -I"libjpeg-turbo-$JVER/include" "libjpeg-turbo-$JVER/lib/libjpeg.dll.a" + +cp "libjpeg-turbo-$JVER/bin/libjpeg-62.dll" . + +7z a -mx9 dcraw-windows.zip dcraw.exe libjpeg-62.dll \ No newline at end of file