chore: v0.0.7 #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-x64 | |
- os: ubuntu-22.04 | |
platform: linux-x64 | |
# - os: macos-11 | |
# platform: darwin-x64 | |
- os: windows-latest | |
platform: win32-x64 | |
- os: windows-latest | |
platform: win32-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') | |
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 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 ${{ matrix.PLATFORM }} | |
- 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 |