Skip to content

Commit

Permalink
feat: improve .yml to copy windows .dll files in the tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafyh committed Jul 29, 2024
1 parent fb41811 commit fd6f599
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG PLATFORM
ARG ARCH

FROM myunisoft91/heif-converter.$PLATFORM:v0.0.1
LABEL maintainer="Nicolas Marteau <[email protected]>"
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,38 @@ jobs:
run: npm install

- name: Create a folder for the tarball
run: mkdir release
run: |
mkdir release
cd release
mkdir lib
- name: Build with Docker (Windows)
- name: Build and run Docker container
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'windows')
run: |
# Build image
docker build --build-arg PLATFORM=${{ matrix.PLATFORM }} -t ${{ matrix.PLATFORM }} . -f ./.github/Dockerfile
# Run container and copy the built file
docker run --name ${{ matrix.PLATFORM }} ${{ matrix.PLATFORM }}
# Copy binary file from container
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/converter.node ./release/converter.${{ matrix.PLATFORM }}.node
# Clean up the Docker container
docker container rm ${{ matrix.PLATFORM }}
# Copy .node file from the container
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/converter.node ./release/lib/converter.${{ matrix.PLATFORM }}.node
- name: Copy .dll files from the container (Windows)
env:
SRC_PATH: /heif-converter/src/build/Release
if: contains(matrix.os, 'windows')
run: |
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/heif.dll ./release/lib/heif.dll
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/turbojpeg.dll ./release/lib/turbojpeg.dll
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/jpeg62.dll ./release/lib/jpeg62.dll
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/libde265.dll ./release/lib/libde265.dll
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/libx265.dll ./release/lib/libx265.dll
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/libpng16.dll ./release/lib/libpng16.dll
docker cp ${{ matrix.PLATFORM }}:${{ env.SRC_PATH }}/zlib1.dll ./release/lib/zlib1.dll
- name: Clean up the Docker container
run: docker container rm ${{ matrix.PLATFORM }}

- name: Create tarball of the release folder
run: |
Expand Down

0 comments on commit fd6f599

Please sign in to comment.