create release #180
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: CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
CMAKE_ARGS: "" | |
- os: macos-latest | |
CMAKE_ARGS: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 | |
- os: windows-latest | |
CMAKE_ARGS: -G"Visual Studio 17 2022" -A"x64" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: contrib | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v1.13 | |
with: | |
cmake-version: '3.23.x' | |
- name: Install prerequisites | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get -y install make autoconf automake tar patch libtool gcc | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
#choco install important_windows_software | |
echo "Nothing to install" | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install autoconf automake libtool | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
# https://github.com/marketplace/actions/visual-studio-shell | |
- name: Set up Visual Studio shell | |
uses: egor-tensin/vs-shell@v2 | |
with: | |
arch: x64 | |
# TODO use appropriate number of cores | |
- name: Build contrib | |
run: | | |
mkdir contrib-build | |
cd contrib-build | |
cmake ${{matrix.CMAKE_ARGS}} -DBUILD_TYPE=ALL -DNUMBER_OF_JOBS=4 ../contrib | |
cmake ${{matrix.CMAKE_ARGS}} -DBUILD_TYPE=OPENMP -DNUMBER_OF_JOBS=4 ../contrib | |
# TODO hope that they finally release a decent uploading action. | |
- name: Clean build | |
shell: bash | |
run: | | |
cd contrib-build | |
rm -rf archives | |
rm -rf src | |
rm -rf CMakeFiles | |
find . -maxdepth 1 -type f -not -name 'contrib_build.log' -delete | |
tar czf contrib_build-${{runner.os}}.tar.gz $(ls -d lib) $(ls -d bin) $(ls -d include) $(ls -d share) | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./contrib-build | |
asset_name: contrib_build-${{runner.os}}.tar.gz | |
asset_content_type: application/gzip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: contrib-build-${{runner.os}} | |
path: contrib-build |