Update build.yml for Windows build configuration #27
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: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Target OS | |
run: | | |
echo "OS_NAME=$(uname -s)" >> $GITHUB_ENV | |
echo "OS_ARCH=$(uname -m)" >> $GITHUB_ENV | |
- name: Build linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
sudo apt install -y libboost-dev libboost-regex-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev | |
./build.sh | |
./cfg/cfg --version | |
- name: Build macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew update | |
brew install boost | |
brew install xerces-c | |
brew install icu4c | |
./configure --with-xml --with-xerces-libraries=/opt/homebrew/opt/icu4c/lib | |
make | |
./cfg/cfg --version | |
- name: Setup MinGW and Boost for Windows | |
if: matrix.os == 'windows-latest' | |
uses: egor-tensin/build-boost@v1 | |
with: | |
version: 1.71.0 | |
libraries: filesystem program_options system regex | |
toolset: mingw | |
platform: x64 | |
configuration: Release | |
static: 1 | |
static-runtime: 1 | |
- name: Build cfg for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
cp .\Makefile.config.win .\Makefile.config | |
make | |
dir -R | |
dir ../ | |
dir ../boost | |
dir ../boost/stage/x64/Release/lib | |
type Makefile.config | |
- name: binaly archive | |
run: | | |
tar -cvzf "cfg_${{ env.OS_NAME }}_${{ env.OS_ARCH }}.tar.gz" ./cfg/cfg | |
echo "ARTIFACT_CFG=cfg_${{ env.OS_NAME }}_${{ env.OS_ARCH }}.tar.gz" >> $GITHUB_ENV | |
ls -la | |
- name: upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cfg_${{ env.OS_NAME }}_${{ env.OS_ARCH }} | |
path: | | |
${{ env.ARTIFACT_CFG }} | |
retention-days: 5 |