Skip to content

Bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows #89

Bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows #89

Workflow file for this run

name: CMake Build Matrix
on: [push]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC", artifact: "cpctools-Windows",
os: windows-2019,
build_type: "Release", cc: "cl", cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat",
libdsk_outfiles: "libdsk-1.5.19/win32vc6/Release/libdsk.lib libdsk-1.5.19/win32vc6/Release/libdsk.dll",
libdir: "instdir/bin",
}
- {
name: "Ubuntu Latest GCC", artifact: "cpctools-Linux",
os: ubuntu-latest,
build_type: "Release", cc: "gcc", cxx: "g++",
libdsk_outfiles: "/tmp/deps/libdsk/lib/*.so",
libdir: "instdir/lib",
}
- {
name: "macOS Latest Clang", artifact: "cpctools-macOS",
os: macos-latest,
build_type: "Release", cc: "clang", cxx: "clang++",
libdsk_outfiles: "/tmp/deps/libdsk/lib/*.dylib",
libdir: "instdir/lib",
}
steps:
- uses: actions/checkout@v1
- name: Install dependencies
shell: cmake -P {0}
run: |
if ("${{ runner.os }}" STREQUAL "Linux")
execute_process(COMMAND sudo apt-get update COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND sudo apt-get install -yq libmagick++-dev COMMAND_ERROR_IS_FATAL ANY)
endif()
#if ("${{ runner.os }}" STREQUAL "macOS")
# execute_process(COMMAND brew install graphicsmagick COMMAND_ERROR_IS_FATAL ANY)
#endif()
#if ("${{ runner.os }}" STREQUAL "Windows")
# execute_process(COMMAND choco install imagemagick COMMAND_ERROR_IS_FATAL ANY)
#endif()
- name: Prepare libdsk
id: libdsk
shell: cmake -P {0}
run: |
file(DOWNLOAD "https://www.seasip.info/Unix/LibDsk/libdsk-1.5.19.tar.gz" ./libdsk.tar.gz SHOW_PROGRESS)
file(MAKE_DIRECTORY /tmp/deps/libdsk)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./libdsk.tar.gz)
if ("${{ runner.os }}" STREQUAL "Windows")
execute_process(COMMAND "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\devenv.exe" win32vc6/libdsk.dsp /upgrade
WORKING_DIRECTORY libdsk-1.5.19 COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\devenv.exe" win32vc6/libdsk.vcxproj /Build Release
WORKING_DIRECTORY libdsk-1.5.19 COMMAND_ERROR_IS_FATAL ANY)
else()
execute_process(COMMAND ./configure --prefix /tmp/deps/libdsk
WORKING_DIRECTORY libdsk-1.5.19 COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND make
WORKING_DIRECTORY libdsk-1.5.19 COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND make install
WORKING_DIRECTORY libdsk-1.5.19 COMMAND_ERROR_IS_FATAL ANY)
endif()
- name: Configure CPCTools
shell: cmake -P {0}
run: |
set(ENV{CC} ${{ matrix.config.cc }})
set(ENV{CXX} ${{ matrix.config.cxx }})
if ("${{ runner.os }}" STREQUAL "Windows")
execute_process(
COMMAND "${{ matrix.config.environment_script }}" x86 && set
OUTPUT_FILE environment_script_output.txt
)
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
endif()
endforeach()
set(LIBDSK_LIB "D:\\a\\cpctools\\cpctools\\libdsk-1.5.19\\win32vc6\\Release")
set(LIBDSK_INC "D:\\a\\cpctools\\cpctools\\libdsk-1.5.19\\include")
set(CMAKE_ARGS -G "Visual Studio 16 2019" -A Win32)
else()
set(LIBDSK_LIB "/tmp/deps/libdsk/lib")
set(LIBDSK_INC "/tmp/deps/libdsk/include")
endif()
execute_process(
COMMAND cmake
-S cpctools
-B build
-D LIBDSK_HEADERS_DIR=${LIBDSK_INC}
-D LIBDSK_LIB_DIR=${LIBDSK_LIB}
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
${CMAKE_ARGS}
COMMAND_ERROR_IS_FATAL ANY
)
- name: Build CPCTools
shell: cmake -P {0}
run: |
set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ")
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
endif()
endforeach()
endif()
execute_process(
COMMAND cmake --build build --config ${{matrix.config.build_type}}
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- name: Install CPCTools
run: cmake --install build --prefix instdir --strip
- name: Install libdsk
shell: bash
run: |
cp ${{ matrix.config.libdsk_outfiles}} ${{ matrix.config.libdir }}
- name: Build fontcatcher
working-directory: font_catcher
shell: cmake -P {0}
run: |
# Disabled on macOS because imagemagick is built without C++ API by homebrew
if ("${{ runner.os }}" STREQUAL "Linux")
execute_process(COMMAND make COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND cp fontcatcher ../instdir/ COMMAND_ERROR_IS_FATAL ANY)
endif()
- name: Upload
uses: actions/upload-artifact@v1
with:
path: ./instdir
name: ${{ matrix.config.artifact }}
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Store Release url
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
- uses: actions/upload-artifact@v1
with:
path: ./upload_url
name: upload_url
publish:
if: contains(github.ref, 'tags/v')
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC", artifact: "cpctools-Windows",
os: ubuntu-latest
}
- {
name: "Ubuntu Latest GCC", artifact: "cpctools-Linux",
os: ubuntu-latest
}
- {
name: "macOS Latest Clang", artifact: "cpctools-macOS",
os: ubuntu-latest
}
needs: release
steps:
- name: Download artifact
uses: actions/[email protected]
with:
name: ${{ matrix.config.artifact }}
path: ${{ matrix.config.artifact }}
- name: Repack artifact
run: |
zip -r ${{ matrix.config.artifact }}.zip ${{ matrix.config.artifact }}
- name: Download URL
uses: actions/[email protected]
with:
name: upload_url
path: .
- id: set_upload_url
run: |
upload_url=`cat ./upload_url`
echo ::set-output name=upload_url::$upload_url
- name: Upload to Release
id: upload_to_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_path: ${{ matrix.config.artifact }}.zip
asset_name: ${{ matrix.config.artifact }}.zip
asset_content_type: application/zip