diff --git a/.dockerignore b/.dockerignore index 3d6ec33..01ebc5c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,4 +7,6 @@ prebuilds index.d.ts LICENSE README.md -docker \ No newline at end of file +docker +src/build +src/node_modules \ No newline at end of file diff --git a/.github/Dockerfile b/.github/Dockerfile index baa311b..c76e183 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,11 +1,12 @@ ARG PLATFORM ARG ARCH + FROM myunisoft91/heif-converter.$PLATFORM:v0.0.1 LABEL maintainer="Nicolas Marteau " WORKDIR heif-converter COPY . . RUN npm install -RUN npm run configure -- --arch=${ARCH:-x64} -RUN npm run build -- --arch=${ARCH:-x64} +RUN npm run configure +RUN npm run build RUN npm run test \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc79f06..898c87d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,19 +15,15 @@ jobs: matrix: include: - os: ubuntu-22.04 - platform: linuxmusl - arch: x64 + platform: linuxmusl-x64 - os: ubuntu-22.04 - platform: linux - arch: x64 + platform: linux-x64 # - os: macos-11 # platform: darwin-x64 - - os: windows-2020 - platform: win32 - arch: x64 - - os: windows-2020 - platform: win32 - arch: ia32 + - os: windows-latest + platform: win32-x64 + - os: windows-latest + platform: win32-ia32 steps: - name: Checkout repository @@ -46,26 +42,26 @@ jobs: - name: Build with Docker (Windows) if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'windows') - env: - PLATFORM: ${{ matrix.platform }}-${{ matrix.arch }} run: | # Build image - docker build --build-arg PLATFORM=${{ env.PLATFORM }} --build-arg ARCH=${{ matrix.arch }} -t ${{ env.PLATFORM }} . -f ./.github/Dockerfile + docker build --build-arg PLATFORM=${{ matrix.PLATFORM }} -t ${{ matrix.PLATFORM }} . -f ./.github/Dockerfile # Run container and copy the built file - docker run --name ${{ env.PLATFORM }} ${{ env.PLATFORM }} - docker cp ${{ env.PLATFORM }}:C:/heif-converter/src/build/Release/converter.node ./release/converter.${{ env.PLATFORM }}.node + 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 ${{ env.PLATFORM }} + docker container rm ${{ matrix.PLATFORM }} - name: Create tarball of the release folder run: | cd ./release - tar -czf ${{ matrix.platform }}-${{ matrix.arch }}.tar.gz * + tar -czf ${{ matrix.platform }}.tar.gz * - name: Upload artifact uses: actions/upload-artifact@v2 with: name: release - path: ./release/${{ matrix.platform }}-${{ matrix.arch }}.tar.gz + path: ./release/${{ matrix.platform }}.tar.gz diff --git a/package.json b/package.json index 2d0ff91..99ba297 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@myunisoft/heif-converter", "description": "Bindings for the libheif C API to convert an image in Node.js", - "version": "0.0.6", + "version": "0.0.7", "keywords": [ "heif", "heic", @@ -46,7 +46,7 @@ "file-type": "^19.0.0", "heic-convert": "^2.1.0", "node-addon-api": "^8.0.0", - "node-gyp": "^10.1.0", + "node-gyp": "10.0.1", "rimraf": "^6.0.1", "tinybench": "^2.8.0" }, diff --git a/src/binding.gyp b/src/binding.gyp index 41d8aa2..7487a46 100644 --- a/src/binding.gyp +++ b/src/binding.gyp @@ -16,12 +16,14 @@ "defines": [ "NAPI_CPP_EXCEPTIONS" ], "conditions": [ [ - 'OS=="linux"', { + 'OS=="linux"', + { "variables": { "VCPKG_LIB_ROOT%": "