-
-
Notifications
You must be signed in to change notification settings - Fork 117
63 lines (57 loc) · 1.75 KB
/
compile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: compile
on:
push:
branches:
- "**"
- "!dependabot/**"
pull_request:
workflow_dispatch:
jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-20.04
triplet: x64-linux
- os: macos-latest
triplet: x64-osx
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false
# Install CMake
- uses: lukka/[email protected]
# Install NASM
- uses: ilammy/setup-nasm@v1
# Launch the MSVC Tools Command Prompt (Windows)
- uses: ilammy/msvc-dev-cmd@v1
# Initialize the CMake directory and build
- name: Build
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_NO_SUBFOLDERS=1
cmake --build build --config Release
# Run tests
- name: Tests
run: |
ctest --test-dir build --build-config Release
# Gather documentation and executables to a common directory
# Ignore copying errors from only one of build/jpegoptim or build/jpegoptim.exe existing
- name: Prepare files
if: matrix.os != 'ubuntu-latest'
run: |
mkdir build/dist
cp build/jpegoptim build/jpegoptim.exe COPYRIGHT LICENSE README build/dist/ 2>/dev/null || true
shell: bash
# Upload the compiled binary
- uses: actions/upload-artifact@v4
if: matrix.os != 'ubuntu-latest'
with:
name: jpegoptim-${{ matrix.triplet }}
path: build/dist