tidy code #21
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: | |
branches: | |
- 'main' | |
- 'master' | |
- 'v*' | |
tags: | |
- v* | |
pull_request: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [run_build] | |
jobs: | |
clean_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: rebuild release body | |
if: github.ref == 'refs/heads/main' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "Latest" | |
title: "Latest development build" | |
build: | |
needs: [clean_release] | |
strategy: | |
matrix: | |
toolchain: ["windows-static-x86", "linux-x86", "windows-static-x64", "linux-x64"] | |
runs-on: ubuntu-latest | |
container: dockcross/${{ matrix.toolchain }}:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
sudo apt-get install --assume-yes p7zip-full | |
git fetch --prune --unshallow | |
- name: Compile project | |
run: | | |
DATEE=`date '+[%Y-%m-%d]'` | |
mv LICENSE LICENCE.TXT | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Release | |
make clean all | |
7z a -t7z ${{ github.event.repository.name }}-${{ matrix.toolchain }}.7z ../Changes.Log ../LICENCE.TXT ../README.md "${{ github.event.repository.name }}*" | |
ls -r | |
- name: Upload artifacts | |
if: ${{ success() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.event.repository.name }}-${{ matrix.toolchain }} | |
path: | | |
build/${{ github.event.repository.name }}-${{ matrix.toolchain }}.7z | |
- name: Deploy pre-release | |
uses: softprops/action-gh-release@v1 | |
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
fail_on_unmatched_files: true | |
files: | | |
build/${{ github.event.repository.name }}-${{ matrix.toolchain }}.7z | |
name: "Latest build" | |
tag_name: "Latest" | |
prerelease: true |