Skip to content

Commit

Permalink
chore: v0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafyh committed Jul 28, 2024
1 parent b040c8e commit fb41811
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ prebuilds
index.d.ts
LICENSE
README.md
docker
docker
src/build
src/node_modules
5 changes: 3 additions & 2 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
ARG PLATFORM
ARG ARCH

FROM myunisoft91/heif-converter.$PLATFORM:v0.0.1
LABEL maintainer="Nicolas Marteau <[email protected]>"

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
32 changes: 14 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
6 changes: 4 additions & 2 deletions src/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
"defines": [ "NAPI_CPP_EXCEPTIONS" ],
"conditions": [
[
'OS=="linux"', {
'OS=="linux"',
{
"variables": {
"VCPKG_LIB_ROOT%": "<!(echo $VCPKG_LIB_ROOT)",
"conditions": [
[
'"<!(echo $VCPKG_LIB_ROOT)" == ""', {
'"<!(echo $VCPKG_LIB_ROOT)" == ""',
{
"VCPKG_LIB_ROOT%": "/vcpkg/installed/x64-linux"
}
]
Expand Down

0 comments on commit fb41811

Please sign in to comment.