Skip to content

Commit

Permalink
ci: update build.yml to run on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafyh committed Aug 1, 2024
1 parent f948a55 commit 7861eeb
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ jobs:
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
uses: dcodeIO/setup-node-nvm@master
with:
node-version: '18'

- name: Install dependencies
run: npm install
node-version: 18

- name: Create a folder for the tarball
run: |
Expand Down Expand Up @@ -67,38 +64,42 @@ jobs:
- 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')
run: |
# Install nasm (useful for vcpkg)
brew install nasm
# Install python setup tools
pip3 install setuptools
# Clone vcpkg and install libheif
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install libheif
# Build project
npm run configure
npm run build
# Run tests
# npm run test
# Copy .node in the release folder
cp ./src/build/Release/converter.node ./release/lib/converter.${{ matrix.PLATFORM }}.node
- name: Create tarball of the release folder
run: |
cd ./release
tar -czf ${{ matrix.platform }}.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: release
path: ./release/${{ matrix.platform }}.tar.gz

- name: "foo"
run: /Users/runner/mynvm/nvm.sh install v18.12.0

# - name: Configure and Build on OSX
# if: contains(matrix.os, 'mac')
# run: |
# # Install nasm (useful for vcpkg)
# brew install nasm

# # Install python setup tools
# pip3 install setuptools

# # Clone vcpkg and install libheif
# git clone https://github.com/microsoft/vcpkg.git
# ./vcpkg/bootstrap-vcpkg.sh
# ./vcpkg/vcpkg install libheif

# # Build project
# npm install
# npm run configure
# npm run build

# # Run tests
# npm run test

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

# - name: Create tarball of the release folder
# run: |
# cd ./release
# tar -czf ${{ matrix.platform }}.tar.gz *

# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: release
# path: ./release/${{ matrix.platform }}.tar.gz

0 comments on commit 7861eeb

Please sign in to comment.