|
9 | 9 | jobs: |
10 | 10 | create_package: |
11 | 11 | timeout-minutes: 10 |
12 | | - runs-on: ${{matrix.os}} |
| 12 | + runs-on: ubuntu-latest # Since fkYAML is a header-only library, just using ubuntu-latest is enough for packaging. |
13 | 13 | strategy: |
14 | 14 | matrix: |
15 | | - os: [ubuntu-latest, windows-latest] |
16 | 15 | single_header: ["ON", "OFF"] |
17 | 16 | include: |
18 | | - - os: ubuntu-latest |
19 | | - artifact_name: fkYAML.tgz |
| 17 | + - artifact_name: fkYAML |
20 | 18 | single_header: "OFF" |
21 | | - - os: ubuntu-latest |
22 | | - artifact_name: fkYAML_single_header.tgz |
23 | | - single_header: "ON" |
24 | | - - os: windows-latest |
25 | | - artifact_name: fkYAML.zip |
26 | | - single_header: "OFF" |
27 | | - - os: windows-latest |
28 | | - artifact_name: fkYAML_single_header.zip |
| 19 | + - artifact_name: fkYAML_single_header |
29 | 20 | single_header: "ON" |
30 | 21 |
|
31 | 22 | steps: |
32 | 23 | - uses: actions/checkout@v4 |
33 | | - with: |
34 | | - submodules: recursive |
| 24 | + |
| 25 | + - name: install zip |
| 26 | + run: sudo apt-get install zip |
35 | 27 |
|
36 | 28 | - name: Configure CMake |
37 | | - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/build/package" -DFK_YAML_USE_SINGLE_HEADER=${{matrix.single_header}} |
| 29 | + 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}} |
38 | 30 |
|
39 | 31 | - name: Install |
40 | 32 | run: | |
41 | 33 | cmake --build ${{github.workspace}}/build --config Release --target install |
42 | | - ls ${{github.workspace}}/build/package |
| 34 | + ls -lAR ${{github.workspace}}/build/${{matrix.artifact_name}} |
43 | 35 |
|
44 | | - - name: Package |
45 | | - shell: bash |
| 36 | + - name: Create tgz/zip archives of the install package |
46 | 37 | run: | |
47 | | - ls '${{github.workspace}}/build' |
48 | | - if [[ "${{ matrix.os }}" == "windows-latest" ]] |
49 | | - then |
50 | | - 7z a ${{matrix.artifact_name}} '${{github.workspace}}/build/package' |
51 | | - else |
52 | | - tar czvf ${{matrix.artifact_name}} '${{github.workspace}}/build/package' |
53 | | - fi |
54 | | - ls |
55 | | -
|
56 | | - - name: Upload Artifacts |
| 38 | + cd ${{github.workspace}}/build |
| 39 | + tar czvf '${{matrix.artifact_name}}.tgz' ./${{matrix.artifact_name}} |
| 40 | + zip -r '${{matrix.artifact_name}}.zip' ./${{matrix.artifact_name}} |
| 41 | +
|
| 42 | + - name: Upload Artifacts (tgz) |
| 43 | + uses: actions/upload-artifact@v4 |
| 44 | + with: |
| 45 | + name: '${{matrix.artifact_name}}.tgz' |
| 46 | + path: '${{github.workspace}}/build/${{matrix.artifact_name}}.tgz' |
| 47 | + |
| 48 | + - name: Upload Artifacts (zip) |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: '${{matrix.artifact_name}}.zip' |
| 52 | + path: '${{github.workspace}}/build/${{matrix.artifact_name}}.zip' |
| 53 | + |
| 54 | + create_minimum_archive: |
| 55 | + timeout-minutes: 10 |
| 56 | + runs-on: ubuntu-latest |
| 57 | + |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + |
| 61 | + - name: install zip |
| 62 | + run: sudo apt-get install zip |
| 63 | + |
| 64 | + - name: Create minimum tgz & zip archives |
| 65 | + working-directory: ${{github.workspace}} |
| 66 | + run: | # create a tgz archive which contains minimum required files to be used as a CMake project (e.g., using FetchContent). |
| 67 | + mkdir fkYAML_min |
| 68 | + cp -vr CMakeLists.txt fkYAML.natvis LICENSE.txt README.md include single_include ./fkYAML_min |
| 69 | + tar czvf fkYAML_min.tgz ./fkYAML_min |
| 70 | + zip -r fkYAML_min.zip ./fkYAML_min |
| 71 | + rm -rf ./fkYAML_min |
| 72 | +
|
| 73 | + - name: Upload the minimum archive (tgz) |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: fkYAML_min.tgz |
| 77 | + path: '${{github.workspace}}/fkYAML_min.tgz' |
| 78 | + |
| 79 | + - name: Upload the minimum archive (zip) |
57 | 80 | uses: actions/upload-artifact@v4 |
58 | 81 | with: |
59 | | - name: ${{matrix.artifact_name}} |
60 | | - path: ${{matrix.artifact_name}} |
| 82 | + name: fkYAML_min.zip |
| 83 | + path: '${{github.workspace}}/fkYAML_min.zip' |
0 commit comments