enhance CI and add example_4 #10
Workflow file for this run
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: "Build Examples" | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: configure | ||
run: cmake -D CMAKE_BUILD_TYPE=Release -B build_example_3 -S example_3 | ||
- name: build example_3 | ||
run: cmake --build build_example_3 --config Release --target example_3 | ||
- name: create example_3 package | ||
run: cmake --build build_example_3 --config Release --target package | ||
- name: check content of *.deb package | ||
id: check-packages | ||
working-directory: build_example_3 | ||
run: | | ||
CMAKE_PROJECT_VERSION=$(cmake --system-information | awk -F= '$1~/CMAKE_PROJECT_VERSION:STATIC/{print$2}') | ||
CMAKE_SYSTEM_NAME=$(cmake -N --system-information | grep "CMAKE_SYSTEM_NAME \"" | cut -d\" -f2) | ||
DEBIAN_PACKAGE_FILENAME="example_3-${CMAKE_PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}.deb" | ||
echo "Checking content of '$DEBIAN_PACKAGE_FILENAME'" | ||
dpkg -c ${DEBIAN_PACKAGE_FILENAME} | ||
echo "DEBIAN_PACKAGE_FILENAME=${DEBIAN_PACKAGE_FILENAME}" >> $GITHUB_OUTPUT | ||
- name: Release | ||
working-directory: build_example_3 | ||
uses: softprops/action-gh-release@v2 | ||
Check failure on line 33 in .github/workflows/build_examples.yml GitHub Actions / Build ExamplesInvalid workflow file
|
||
## if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ${{ steps.check-packages.outputs.DEBIAN_PACKAGE_FILENAME }} | ||
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | ||
tag_name: latest | ||
# TODO: check https://github.com/marketplace/actions/cmake-swiss-army-knife | ||
# TODO: check https://github.com/actions/starter-workflows/blob/9f1db534549e072c20d5d1a79e0a4ff45a674caf/ci/cmake-multi-platform.yml#L20 | ||