Skip to content

Duplicate code removal. #34

Duplicate code removal.

Duplicate code removal. #34

name: Ubuntu Release Package
on:
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Catch2 v3 from source
run: |
git clone https://github.com/catchorg/Catch2.git
cd Catch2
git checkout v3.5.2
cmake -Bbuild -S. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install
- name: Prep License File for Distribution
run: |
fold -s LICENSE > LICENSE2
mv LICENSE2 LICENSE
- name: Configure CMake
run: cmake --preset gh-ubuntu-release
- name: Build
run: cmake --build ${{github.workspace}}/build/release/gh-ubuntu
- name: Test
working-directory: ${{github.workspace}}/build/release/gh-ubuntu
run: ctest
- name: Package tar.gz
working-directory: ${{github.workspace}}/build/release/gh-ubuntu
run: cpack
- name: Package .deb
working-directory: ${{github.workspace}}/build/release/gh-ubuntu
run: |
cmake -DCPACK_GENERATOR=DEB .
cpack -G DEB
- name: Package .rpm
working-directory: ${{github.workspace}}/build/release/gh-ubuntu
run: |
cmake -DCPACK_GENERATOR=RPM .
sudo cpack -G RPM
- name: Archive Build Artifacts
uses: actions/upload-artifact@v4
with:
name: ubuntu-22.04
path: |
${{github.workspace}}/build/release/gh-ubuntu/sac-format-?.?.?-Linux-*.tar.gz*
${{github.workspace}}/build/release/gh-ubuntu/sac-format-?.?.?-Linux-*.sh*
${{github.workspace}}/build/release/gh-ubuntu/sac-format.deb*
${{github.workspace}}/build/release/gh-ubuntu/sac-format.rpm*
retention-days: 1