[ResourceLib/Tool] Use dynamic libraries on Linux #210
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
build_windows: | |
name: Build (Windows) | |
runs-on: [ windows-latest ] | |
steps: | |
- name: Get latest CMake and ninja | |
uses: lukka/get-cmake@latest | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup VS environment | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: Generate projects | |
run: | | |
mkdir _build | |
cd _build | |
cmake -G Ninja ` | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` | |
-DCMAKE_CXX_COMPILER=cl ` | |
-DCMAKE_C_COMPILER=cl ` | |
.. | |
- name: Build | |
run: | | |
cmake --build _build -j2 | |
- name: Copy ResourceTool artifacts | |
run: | | |
cd _build | |
mkdir _resourcetool | |
Copy-Item ResourceTool.exe -Destination _resourcetool/ | |
Copy-Item ResourceTool.pdb -Destination _resourcetool/ | |
Copy-Item ResourceLib_HM2.dll -Destination _resourcetool/ | |
Copy-Item ResourceLib_HM2.pdb -Destination _resourcetool/ | |
Copy-Item ResourceLib_HM3.dll -Destination _resourcetool/ | |
Copy-Item ResourceLib_HM3.pdb -Destination _resourcetool/ | |
Copy-Item ResourceLib_HM2016.dll -Destination _resourcetool/ | |
Copy-Item ResourceLib_HM2016.pdb -Destination _resourcetool/ | |
Copy-Item ResourceLib_HMA.dll -Destination _resourcetool/ | |
Copy-Item ResourceLib_HMA.pdb -Destination _resourcetool/ | |
Copy-Item ../LICENSE -Destination _resourcetool/ | |
- name: Copy CodeGen artifacts | |
run: | | |
cd _build | |
mkdir _codegen | |
Copy-Item CodeGen.exe -Destination _codegen/ | |
Copy-Item CodeGen.pdb -Destination _codegen/ | |
Copy-Item CodeGenLib.dll -Destination _codegen/ | |
Copy-Item CodeGenLib.pdb -Destination _codegen/ | |
Copy-Item PropertyBundler.exe -Destination _codegen/ | |
Copy-Item PropertyBundler.pdb -Destination _codegen/ | |
Copy-Item ../LICENSE -Destination _codegen/ | |
- name: Copy ResourceLib artifacts | |
run: | | |
cd _build | |
mkdir _resourcelib | |
mkdir _resourcelib/Include | |
Copy-Item ResourceLib_HM2.dll -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM2.lib -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM2.pdb -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM3.dll -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM3.lib -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM3.pdb -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM2016.dll -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM2016.lib -Destination _resourcelib/ | |
Copy-Item ResourceLib_HM2016.pdb -Destination _resourcelib/ | |
Copy-Item ResourceLib_HMA.dll -Destination _resourcelib/ | |
Copy-Item ResourceLib_HMA.lib -Destination _resourcelib/ | |
Copy-Item ResourceLib_HMA.pdb -Destination _resourcelib/ | |
Copy-Item ../Libraries/ResourceLib/Include/* -Destination _resourcelib/Include/ | |
Copy-Item ../Libraries/ResourceLib/ResourceLib.cs -Destination _resourcelib/ | |
Copy-Item ../LICENSE -Destination _resourcelib/ | |
- name: Archive ResourceTool | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ResourceTool-win-x64 | |
path: | | |
_build/_resourcetool/* | |
- name: Archive CodeGen | |
uses: actions/upload-artifact@v2 | |
with: | |
name: CodeGen-win-x64 | |
path: | | |
_build/_codegen/* | |
- name: Archive ResourceLib | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ResourceLib-win-x64 | |
path: | | |
_build/_resourcelib/* | |
build_linux: | |
name: Build (Linux) | |
runs-on: [ ubuntu-22.04 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Set up Clang | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: 17 | |
platform: x64 | |
- name: Generate projects | |
run: | | |
mkdir _build | |
cd _build | |
cmake -G "Unix Makefiles" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_CXX_COMPILER=clang++-17 \ | |
-DCMAKE_C_COMPILER=clang-17 \ | |
.. | |
- name: Build | |
run: | | |
cmake --build _build -j2 | |
- name: Copy resource lib artifacts | |
run: | | |
cd _build | |
mkdir _resourcelib | |
cp -r ../Libraries/ResourceLib/Include _resourcelib/ | |
cp ../Libraries/ResourceLib/ResourceLib.cs _resourcelib/ | |
cp ResourceLib*.so _resourcelib/ | |
cp ../LICENSE _resourcelib/ | |
- name: Copy resource tool artifacts | |
run: | | |
cd _build | |
mkdir _resourcetool | |
cp ResourceTool _resourcetool/ | |
cp ../LICENSE _resourcetool/ | |
- name: Archive resource tool | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ResourceTool-linux-x64 | |
path: | | |
_build/_resourcetool/* | |
_build/_resourcelib/*.so | |
- name: Archive resource lib | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ResourceLib-linux-x64 | |
path: | | |
_build/_resourcelib/* | |
create_release: | |
name: Create release | |
needs: [build_windows, build_linux] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create.outputs.upload_url }} | |
steps: | |
- name: Create release | |
id: create | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: startsWith(github.ref, 'refs/tags/v0.') | |
upload_release: | |
name: Upload release artifacts | |
needs: create_release | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
artifact: [ ResourceTool-win-x64, ResourceTool-linux-x64, CodeGen-win-x64, ResourceLib-win-x64, ResourceLib-linux-x64 ] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ matrix.artifact }} | |
path: ${{ matrix.artifact }} | |
- name: Archive artifact files | |
run: | | |
cd ${{ matrix.artifact }} | |
zip -r ${{ matrix.artifact }}.zip * | |
- name: Upload release assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ${{ matrix.artifact }}/${{ matrix.artifact }}.zip | |
asset_name: ${{ matrix.artifact }}.zip | |
asset_content_type: application/zip |