Skip to content

chore: v0.0.7

chore: v0.0.7 #10

Workflow file for this run

name: Build and Retrieve Compiled Files
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
platform: linuxmusl
arch: x64
- os: ubuntu-22.04
platform: linux
arch: x64
# - os: macos-11
# platform: darwin-x64
- os: windows-latest
platform: win32
arch: x64
- os: windows-latest
platform: win32
arch: ia32
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Create a folder for the tarball
run: mkdir release
- 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
# Run container and copy the built file
docker run --name ${{ env.PLATFORM }} ${{ env.PLATFORM }}
# Determine the path based on the platform
if [[ "${{ matrix.platform }}" == "win32" ]]; then
CONVERTER_PATH="C:/heif-converter/src/build/Release/converter.node"
else
CONVERTER_PATH="/heif-converter/src/build/Release/converter.node"
fi
# Copy binary file from container
docker cp ${{ env.PLATFORM }}:${CONVERTER_PATH} ./release/converter.${{ env.PLATFORM }}.node
# Clean up the Docker container
docker container rm ${{ env.PLATFORM }}
- name: Create tarball of the release folder
run: |
cd ./release
tar -czf ${{ matrix.platform }}-${{ matrix.arch }}.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: release
path: ./release/${{ matrix.platform }}-${{ matrix.arch }}.tar.gz