fix state, end flag #130
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: kmtricks | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
- 'docker/**' | |
- 'conda/**' | |
- 'scripts/**' | |
- '.gitignore' | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
- 'docker/**' | |
- 'conda/**' | |
- 'scripts/**' | |
- '.gitignore' | |
jobs: | |
Linux: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [Release, Debug] | |
compiler: [g++-8, g++-9, g++-10] | |
include: | |
- compiler: g++-8 | |
cxx: g++-8 | |
cc: gcc-8 | |
- compiler: g++-9 | |
cxx: g++-9 | |
cc: gcc-9 | |
- compiler: g++-10 | |
cxx: g++-10 | |
cc: gcc-10 | |
name: Linux - ${{ matrix.build_type }} - ${{ matrix.compiler }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Dependencies | |
run: | | |
sudo apt-get install ${{ matrix.compiler }} | |
sudo apt-get install zlib1g zlib1g-dev | |
- name: Configure | |
shell: bash | |
run: | | |
mkdir build | |
cd build | |
export CC=$(which ${{ matrix.cc }}) | |
export CXX=$(which ${{ matrix.cxx }}) | |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCOMPILE_TESTS=ON -DMAKE_PACKAGE=ON -DWITH_MODULES=ON -DWITH_HOWDE=ON -DWITH_SOCKS=ON -DSTATIC=ON | |
- name: Build | |
shell: bash | |
run: | | |
cd build | |
export CC=$(which ${{ matrix.cc }}) | |
export CXX=$(which ${{ matrix.cxx }}) | |
make -j2 | |
- name: Test | |
shell: bash | |
run: cd build && ctest --verbose | |
- name: Package | |
if: matrix.compiler == 'g++-10' && matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
shell: bash | |
run: cd build && make package | |
- name: Get tag name | |
if: matrix.compiler == 'g++-10' && matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
id: tag | |
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/} | |
- name: Release archive | |
if: matrix.compiler == 'g++-10' && matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
shell: bash | |
run: | | |
mkdir archive_files | |
bash scripts/git-archive-all.sh --format tar.gz ./archive_files/kmtricks-${{ steps.tag.outputs.TAG }}-sources.tar.gz | |
mv build/kmtricks-${{ steps.tag.outputs.TAG }}-bin-Linux.tar.gz archive_files | |
- name: Changelog | |
if: matrix.compiler == 'g++-10' && matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
id: changelog | |
shell: bash | |
run: | | |
r=$(cat doc/changelogs/${{ steps.tag.outputs.TAG }}.md) | |
r="${r//'%'/'%25'}" | |
r="${r//$'\n'/'%0A'}" | |
r="${r//$'\r'/'%0D'}" | |
echo "::set-output name=RELEASE_BODY::$r" | |
- name: Release | |
if: matrix.compiler == 'g++-10' && matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
release_name: Release ${{ steps.tag.outputs.TAG }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'archive_files/*' | |
file_glob: true | |
tag: ${{ github.ref }} | |
body: | | |
${{ steps.changelog.outputs.RELEASE_BODY }} | |
prerelease: true | |
MacOS: | |
runs-on: macos-10.15 | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [Release, Debug] | |
name: MacOS - ${{ matrix.build_type }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Dependencies | |
run: brew install zlib | |
- name: Configure | |
shell: bash | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCOMPILE_TESTS=ON -DMAKE_PACKAGE=ON -DWITH_MODULES=ON -DWITH_HOWDE=ON -DWITH_SOCKS=ON | |
- name: Build | |
shell: bash | |
run: cd build && make -j2 | |
- name: Test | |
shell: bash | |
run: cd build && ctest --verbose | |
- name: Package | |
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
shell: bash | |
run: cd build && make package | |
- name: Get tag name | |
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
id: tag | |
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/} | |
- name: Release archive | |
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
shell: bash | |
run: | | |
mkdir archive_files | |
mv build/kmtricks-${{ steps.tag.outputs.TAG }}-bin-Darwin.tar.gz archive_files | |
- name: Changelog | |
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
id: changelog | |
shell: bash | |
run: | | |
r=$(cat doc/changelogs/${{ steps.tag.outputs.TAG }}.md) | |
r="${r//'%'/'%25'}" | |
r="${r//$'\n'/'%0A'}" | |
r="${r//$'\r'/'%0D'}" | |
echo "::set-output name=RELEASE_BODY::$r" | |
- name: Release | |
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
release_name: Release ${{ steps.tag.outputs.TAG }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'archive_files/*' | |
file_glob: true | |
tag: ${{ github.ref }} | |
body: | | |
${{ steps.changelog.outputs.RELEASE_BODY }} | |
prerelease: true | |