Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use vcpkg binary files to compile .node on github action #5

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 14 additions & 32 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,47 +68,29 @@ jobs:
- name: Create a folder for the tarball
run: mkdir -p release/${{ matrix.PLATFORM }}/lib

- 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 .node file from the container
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/converter.node ./release/${{ matrix.PLATFORM }}/lib/converter.${{ matrix.PLATFORM }}.node

- name: Copy .dll files from the container (Windows)
if: contains(matrix.os, 'windows')
run: |
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/heif.dll ./release/${{ matrix.PLATFORM }}/lib/heif.dll
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/turbojpeg.dll ./release/${{ matrix.PLATFORM }}/lib/turbojpeg.dll
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/jpeg62.dll ./release/${{ matrix.PLATFORM }}/lib/jpeg62.dll
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/libde265.dll ./release/${{ matrix.PLATFORM }}/lib/libde265.dll
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/libx265.dll ./release/${{ matrix.PLATFORM }}/lib/libx265.dll
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/libpng16.dll ./release/${{ matrix.PLATFORM }}/lib/libpng16.dll
docker cp ${{ matrix.PLATFORM }}:/heif-converter/src/build/Release/zlib1.dll ./release/${{ matrix.PLATFORM }}/lib/zlib1.dll

- name: Clean up the Docker container (Windows and Linux)
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'windows')
run: docker container rm ${{ matrix.PLATFORM }}

- name: Configure and Build on OSX
if: contains(matrix.os, 'mac')
- name: Configure and Build projects
run: |
# Build project
npm install --omit-optional
npm run configure
npm run build

# Run tests
npm run test

# Copy .node in the release folder
cp ./src/build/Release/converter.node ./release/${{ matrix.PLATFORM }}/lib/converter.${{ matrix.PLATFORM }}.node

- name: Copy .dll files for artifacts and tests (Windows)
if: contains(matrix.os, 'windows')
run: |
# Copy for artifact
cp platform/${{ matrix.PLATFORM }}/bin/heif.dll ./release/${{ matrix.PLATFORM }}/lib/heif.dll
cp platform/${{ matrix.PLATFORM }}/bin/turbojpeg.dll ./release/${{ matrix.PLATFORM }}/lib/turbojpeg.dll
cp platform/${{ matrix.PLATFORM }}/bin/libde265.dll ./release/${{ matrix.PLATFORM }}/lib/libde265.dll
cp platform/${{ matrix.PLATFORM }}/bin/libx265.dll ./release/${{ matrix.PLATFORM }}/lib/libx265.dll
cp platform/${{ matrix.PLATFORM }}/bin/libpng16.dll ./release/${{ matrix.PLATFORM }}/lib/libpng16.dll

- name: Run tests
run: npm run test

- name: Create tarball of the release folder
run: |
cd ./release
Expand Down
Loading
Loading