diff --git a/.github/workflows/package.yaml b/.github/workflows/release.yaml similarity index 96% rename from .github/workflows/package.yaml rename to .github/workflows/release.yaml index f9dce80..6efceeb 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/release.yaml @@ -2,12 +2,14 @@ name: Package For Windows on: push: + branches: + - master tags: - 'v*' jobs: package: - name: Package + name: Package Release runs-on: windows-latest steps: - name: Checkout Repo diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..3122dfa --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,55 @@ +name: Package Test + +on: + pull_request: + types: [ synchronize ] + +jobs: + package: + name: Test + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@master + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + - name: Install Poppler + shell: bash -l {0} + run: conda install -c conda-forge poppler -y + - name: Run Package Script + shell: bash -l {0} + run: ./package.sh + env: + PKGS_PATH_DIR: /c/Users/runneradmin/conda_pkgs_dir + + - name: Test pdfattach + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdfattach.exe D:\a\poppler-windows\poppler-windows\sample.pdf D:\a\poppler-windows\poppler-windows\sample.pdf test.pdf + - name: Test pdfdetach + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdfdetach.exe -list D:\a\poppler-windows\poppler-windows\sample.pdf + - name: Test pdffonts + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdffonts.exe -v + - name: Test pdfimages + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdfimages.exe -v + - name: Test pdfinfo + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdfinfo.exe -v + - name: Test pdftocairo + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdftocairo.exe -v + - name: Test pdftohtml + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdftohtml.exe -v + - name: Test pdftoppm + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdftoppm.exe -v + - name: Test pdftops + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdftops.exe -v + - name: Test pdftotext + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdftotext.exe -v + - name: Test pdfunite + run: D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }}\Library\bin\pdfunite.exe -v + + - name: Zip Release + run: Compress-Archive D:\a\poppler-windows\poppler-windows\poppler-${{ env.POPPLER_VERSION }} Release-${{ env.POPPLER_VERSION }}.zip + shell: pwsh + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: Poppler-${{ env.POPPLER_VERSION }} + path: D:\a\poppler-windows\poppler-windows\Release-${{ env.POPPLER_VERSION }}.zip diff --git a/package.sh b/package.sh index 0d05463..2c5eef9 100755 --- a/package.sh +++ b/package.sh @@ -1,6 +1,9 @@ POPPLER_VERSION=21.08.0 POPPLER_DATA_URL="https://poppler.freedesktop.org/poppler-data-0.4.10.tar.gz" +set -e +set -o pipefail + mkdir "poppler-$POPPLER_VERSION" cd "poppler-$POPPLER_VERSION" || exit @@ -17,6 +20,14 @@ cp "$PKGS_PATH_DIR"/openssl*/Library/bin/libcrypto-1_1-x64.dll ./Library/bin/ cp "$PKGS_PATH_DIR"/openjpeg*/Library/bin/openjp2.dll ./Library/bin/ cp "$PKGS_PATH_DIR"/xz*/Library/bin/liblzma.dll ./Library/bin/ cp "$PKGS_PATH_DIR"/cairo*/Library/bin/cairo.dll ./Library/bin/ +cp "$PKGS_PATH_DIR"/libdeflate*/Library/bin/libdeflate.dll ./Library/bin/ +cp "$PKGS_PATH_DIR"/lerc*/Library/bin/Lerc.dll ./Library/bin/ +cp "$PKGS_PATH_DIR"/jbig*/Library/bin/jbig.dll ./Library/bin/ +cp "$PKGS_PATH_DIR"/lcms2*/Library/bin/lcms2.dll ./Library/bin/ +cp "$PKGS_PATH_DIR"/libxml2*/Library/bin/libxml2.dll ./Library/bin/ +cp -a "$PKGS_PATH_DIR"/libiconv*/Library/bin/. ./Library/bin/ + +rm -rf "$PKGS_PATH_DIR" mkdir -p share/poppler cd share || exit diff --git a/sample.pdf b/sample.pdf new file mode 100644 index 0000000..dbf091d Binary files /dev/null and b/sample.pdf differ