CMake #10
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: CMake | |
on: | |
workflow_dispatch: | |
inputs: | |
relName: | |
description: 'Release Name' | |
required: true | |
default: 'Release v1.0.0' | |
tagName: | |
description: 'Release tag' | |
required: true | |
default: "" | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | |
# You can convert this to a matrix build if you need cross-platform coverage. | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Init and update submodules | |
run: | | |
git submodule init | |
git submodule update | |
- name: Install gcc-multilib, g++-multilib | |
run: sudo apt-get install -y gcc-multilib g++-multilib | |
- name: Build | |
# Build your program with the given configuration | |
run: | | |
chmod +x ./build.sh | |
./build.sh | |
shell: bash | |
- name: Create artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-artifacts | |
path: | | |
${{github.workspace}}/output | |
- name: Create Release | |
id: create_release | |
if: ${{ github.event_name == 'workflow_dispatch'}} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.event.inputs.tagName }} | |
release_name: ${{ github.event.inputs.relName }} | |
body: "" | |
draft: false | |
prerelease: false | |
- name: Create zip of compile outputs | |
uses: papeloto/action-zip@v1 | |
if: ${{ github.event_name == 'workflow_dispatch'}} | |
with: | |
files: output | |
dest: creamlinux.zip | |
- name: Upload Release Assets | |
if: ${{ github.event_name == 'workflow_dispatch'}} | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./creamlinux.zip | |
asset_name: creamlinux.zip | |
asset_content_type: application/zip | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest -C ${{env.BUILD_TYPE}} | |