Skip to content

Commit

Permalink
Split on workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Oct 24, 2023
1 parent cb6fc19 commit 551a7c5
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 251 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build for Darwin

on:
workflow_call:
inputs:
output-artifact-name:
description: Name of artifact as which Darwin executable to be uploaded
required: true
type: string

jobs:
build-darwin:
name: Build MacOS executable
runs-on: macos-latest
steps:
- name: Install Conan
run: pip3 install conan==2.0.10

- uses: actions/checkout@v3

- name: Detect conan profile
run: conan profile detect

- name: Install conan dependencies
run: conan install . --build=missing -s build_type=Release

- name: Invoke 'conan-release' preset
run: cmake --preset conan-release

- name: Build the app
run: cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt && cmake --build . --config Release

- name: Upload executable as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.output-artifact-name }}
path: bin/lottie_to_png
73 changes: 73 additions & 0 deletions .github/workflows/build-linux-and-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build for Linux & Docker

on:
workflow_call:
inputs:
output-artifact-name:
description: Name of artifact as which Docker image to be uploaded
required: true
type: string
arch:
description: "amd64 or arm64"
required: true
type: string

jobs:
build-docker:
name: Build linux and docker images
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker caching
uses: jpribyl/[email protected]
continue-on-error: true

- name: Build lottie-to-apng
run: docker build -t lottie-to-apng:${{ inputs.arch }} --target lottie-to-apng --platform ${{ inputs.arch }} .

- name: Upload lottie-to-apng as artifact
uses: ishworkh/[email protected]
with:
image: lottie-to-apng:${{ inputs.arch }}

- name: Build lottie-to-gif
run: docker build -t lottie-to-gif:${{ inputs.arch }} --target lottie-to-gif --platform ${{ inputs.arch }} .

- name: Upload lottie-to-gif as artifact
uses: ishworkh/[email protected]
with:
image: lottie-to-gif:${{ inputs.arch }}

- name: Build lottie-to-png
run: docker build -t lottie-to-png:${{ inputs.arch }} --target lottie-to-png --platform ${{ inputs.arch }} .

- name: Upload lottie-to-png as artifact
uses: ishworkh/[email protected]
with:
image: lottie-to-png:${{ inputs.arch }}

- name: Build lottie-to-webp
run: docker build -t lottie-to-webp:${{ inputs.arch }} --target lottie-to-webp --platform ${{ inputs.arch }} .

- name: Upload lottie-to-webp as artifact
uses: ishworkh/[email protected]
with:
image: lottie-to-webp:${{ inputs.arch }}

- name: Extract executable
run: |
id=$(docker create lottie-to-png:${{ inputs.arch }}) &&
docker cp $id:/usr/bin/lottie_to_png bin/ &&
docker rm -v $id
- name: Upload executable as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.output-artifact-name }}
path: bin/lottie_to_png
37 changes: 37 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build for Windows

on:
workflow_call:
inputs:
output-artifact-name:
description: Name of artifact as which Windows executable to be uploaded
required: true
type: string

jobs:
build-windows:
name: Build Windows executable
runs-on: windows-latest
steps:
- name: Install Conan
run: pip3 install conan==2.0.10

- uses: actions/checkout@v3

- name: Detect conan profile
run: conan profile detect

- name: Install conan dependencies
run: conan install . --build=missing -s build_type=Release

- name: Invoke 'conan-default' preset
run: cmake --preset conan-default

- name: Build the app
run: cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt && cmake --build . --config Release

- name: Upload executable as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.output-artifact-name }}
path: bin/Release/lottie_to_png.exe
Loading

0 comments on commit 551a7c5

Please sign in to comment.