ReleasePackage #28
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: ReleasePackage | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
create_package: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest # Since fkYAML is a header-only library, just using ubuntu-latest is enough for packaging. | |
strategy: | |
matrix: | |
single_header: ["ON", "OFF"] | |
include: | |
- artifact_name: fkYAML | |
single_header: "OFF" | |
- artifact_name: fkYAML_single_header | |
single_header: "ON" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install zip | |
run: sudo apt-get install zip | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/build/${{matrix.artifact_name}}" -DFK_YAML_USE_SINGLE_HEADER=${{matrix.single_header}} | |
- name: Install | |
run: | | |
cmake --build ${{github.workspace}}/build --config Release --target install | |
ls -lAR ${{github.workspace}}/build/${{matrix.artifact_name}} | |
- name: Create tgz/zip archives of the install package | |
run: | | |
cd ${{github.workspace}}/build | |
tar czvf '${{matrix.artifact_name}}.tgz' ./${{matrix.artifact_name}} | |
zip -r '${{matrix.artifact_name}}.zip' ./${{matrix.artifact_name}} | |
- name: Upload Artifacts (tgz) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{matrix.artifact_name}}.tgz' | |
path: '${{github.workspace}}/build/${{matrix.artifact_name}}.tgz' | |
- name: Upload Artifacts (zip) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{matrix.artifact_name}}.zip' | |
path: '${{github.workspace}}/build/${{matrix.artifact_name}}.zip' | |
create_minimum_archive: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install zip | |
run: sudo apt-get install zip | |
- name: Create minimum tgz & zip archives | |
working-directory: ${{github.workspace}} | |
run: | # create a tgz archive which contains minimum required files to be used as a CMake project (e.g., using FetchContent). | |
mkdir fkYAML_min | |
cp -vr CMakeLists.txt fkYAML.natvis LICENSE.txt README.md include single_include ./fkYAML_min | |
tar czvf fkYAML_min.tgz ./fkYAML_min | |
zip -r fkYAML_min.zip ./fkYAML_min | |
rm -rf ./fkYAML_min | |
- name: Upload the minimum archive (tgz) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fkYAML_min.tgz | |
path: '${{github.workspace}}/fkYAML_min.tgz' | |
- name: Upload the minimum archive (zip) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fkYAML_min.zip | |
path: '${{github.workspace}}/fkYAML_min.zip' |