forked from Titans-Project/BfaCore-Reforged
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
123 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
|
||
name: windows-build | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'sql/**' | ||
pull_request: | ||
paths-ignore: | ||
- 'sql/**' | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) | ||
cancel-in-progress: true | ||
|
||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
REPO_DIR : ${{github.workspace}} | ||
BUILD_DIR: ${{github.workspace}}/bin/builddir | ||
BOOST_TOOLSET: "msvc14.1" | ||
BOOST_VERSION: "1.69.0" | ||
BOOST_INSTALL_DIR: "${{github.workspace}}/bin" | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
#git checkout | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: FranzDiebold/github-env-vars-action@v2 | ||
- name: Create Build Environment | ||
run: | | ||
echo "BOOST_ROOT=${{env.BOOST_INSTALL_DIR}}/boost/boost-${{env.BOOST_VERSION}}-win32-${{env.BOOST_TOOLSET}}-x86_64" >> $env:GITHUB_ENV | ||
echo "ARCHIVE_FILENAME=$env:CI_REPOSITORY_NAME-${{matrix.TYPE}}-$env:CI_SHA_SHORT.zip" >> $env:GITHUB_ENV | ||
cmake -E make_directory ${{ env.BUILD_DIR }} | ||
# install dependencies | ||
- name: Cache Windows boost | ||
uses: actions/cache@v2 | ||
id: cache-boost | ||
with: | ||
path: "${{env.BOOST_INSTALL_DIR}}/boost" | ||
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }} | ||
|
||
- if: steps.cache-boost.outputs.cache-hit != 'true' | ||
name: Install boost | ||
uses: MarkusJx/[email protected] | ||
id: install-boost | ||
with: | ||
# REQUIRED: Specify the required boost version | ||
# A list of supported versions can be found here: | ||
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json | ||
boost_version: ${{env.BOOST_VERSION}} | ||
# OPTIONAL: Specify a toolset on windows | ||
toolset: ${{env.BOOST_TOOLSET}} | ||
# OPTIONAL: Specify a custon install location | ||
boost_install_dir: ${{env.BOOST_INSTALL_DIR}} | ||
# NOTE: If a boost version matching all requirements cannot be found, | ||
# this build step will fail | ||
- name: windows dependencies | ||
#Sets versions for ACE | ||
#env: | ||
# ACE_VERSION: 6.5.11 | ||
# ACE_VERSION2: 6_5_11 | ||
|
||
run: | | ||
#make | ||
choco install -y make | ||
#cmake | ||
choco install -y cmake | ||
#openssl | ||
choco install -y openssl | ||
#git bash shell | ||
shell: bash | ||
|
||
#build and install | ||
- name: windows build & install | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
mkdir -p build && cd build | ||
cmake .. -DTOOLS=ON -DELUNA=0 -A x64 | ||
cmake --build . --config RelWithDebInfo --parallel 4 | ||
#git bash shell | ||
shell: bash | ||
- name: Create Upload File Name | ||
run: | | ||
echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $env:GITHUB_ENV | ||
- name: Archive files | ||
run: | | ||
#data is in Release folder | ||
cd ${{github.workspace}}/build/bin | ||
dir | ||
copy "C:/Program Files/OpenSSL/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/build/bin/RelWithDebInfo/libssl-1_1-x64.dll | ||
copy "c:/Program Files/OpenSSL/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/build/bin/RelWithDebInfo/libcrypto-1_1-x64.dll | ||
7z a -tzip ${{env.ARCHIVE_FILENAME}} RelWithDebInfo | ||
- name: Archive this artefact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: snapshot-devbuild | ||
path: "${{github.workspace}}/build/bin/${{env.ARCHIVE_FILENAME}}" | ||
|
||
- name: Download artifact snapshot-Release | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: snapshot-devbuild | ||
path: all_snapshots | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
|
||
- name: Upload snapshot | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "Development Build(${{ steps.date.outputs.date }})" | ||
files: all_snapshots |