Release / Linux (x64) #25
This file contains hidden or 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: Release / Linux (x64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch_name: | |
| description: 'Branch to run on' | |
| required: true | |
| default: 'master' | |
| type: string | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch_name }} | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Install packages | |
| run: | | |
| sudo apt update | |
| sudo apt install -y cmake build-essential qtbase5-dev libqt5serialport5-dev qtscript5-dev qttools5-dev libqt5websockets5-dev qtmultimedia5-dev qtwebengine5-dev | |
| - name: Configure CMake | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/Candle -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4 | |
| - name: Install | |
| run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
| - name: Get latest tag | |
| id: tag | |
| run: | | |
| tag=$(git describe --tags --abbrev=0) | |
| version=${tag#v} | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| - name: Prepare package | |
| run: | | |
| mkdir -p ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}}/opt/candle | |
| cp -r ${{github.workspace}}/build/Candle/* ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}}/opt/candle | |
| cp -r ${{github.workspace}}/deploy/linux/* ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}} | |
| sed -i 's/{version}/${{steps.tag.outputs.version}}/' ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}}/DEBIAN/control | |
| chmod 0755 ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}}/DEBIAN/postinst ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}}/DEBIAN/prerm | |
| dpkg-deb --build ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: candle-${{steps.tag.outputs.version}}-linux | |
| path: ${{github.workspace}}/deploy/candle-${{steps.tag.outputs.version}}.deb |