update libOpenWinControls #4
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: rolling release | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| win_release: | |
| runs-on: windows-latest | |
| outputs: | |
| win_release_pkg_id: ${{steps.win_release_zip.outputs.artifact-id}} | |
| steps: | |
| - uses: actions/checkout@main | |
| with: | |
| path: OpenWinControls | |
| submodules: true | |
| - name: init submodules | |
| run: | | |
| cd OpenWinControls | |
| git submodule update --init --recursive | |
| - name: prepare release folder | |
| run: mkdir "owc_windows" | |
| - name: build | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| cd OpenWinControls | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja | |
| ninja -C build | |
| copy build\OpenWinControlsCLI.exe ${{github.workspace}}\owc_windows | |
| - name: upload windows release | |
| id: win_release_zip | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: owc_windows | |
| path: owc_windows | |
| retention-days: 1 | |
| linux_release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| linux_owc_appimg_id: ${{steps.linux_appimg.outputs.artifact-id}} | |
| steps: | |
| - uses: actions/checkout@main | |
| with: | |
| path: OpenWinControls | |
| submodules: true | |
| - name: init submodules | |
| run: | | |
| cd OpenWinControls | |
| git submodule update --init --recursive | |
| - name: install required libs | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libudev-dev libusb-1.0-0-dev | |
| - name: download linuxdeploy and plugins | |
| run: | | |
| wget -q --show-progress https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
| curl -fsSLo linuxdeploy-plugin-checkrt.sh https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh | |
| chmod +x linuxdeploy-plugin-checkrt.sh | |
| chmod +x linuxdeploy-*.AppImage | |
| - name: prepare release folders | |
| run: mkdir "owc_linux" | |
| - name: build | |
| run: | | |
| cd OpenWinControls | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=usr | |
| make -C build -j`nproc` install | |
| - name: prepare appimage | |
| run: | | |
| mkdir -p OpenWinControls/usr/share/metainfo | |
| mkdir OpenWinControls/AppDir | |
| mv OpenWinControls/usr OpenWinControls/AppDir/usr | |
| cp OpenWinControls/linux/appimage/org.owc.openwincontrolscli.appdata.xml OpenWinControls/AppDir/usr/share/metainfo | |
| - name: make appimage | |
| run: > | |
| LD_LIBRARY_PATH=$LD_LIBRARY_PATH:OpenWinControls/AppDir/usr/lib | |
| ./linuxdeploy-x86_64.AppImage | |
| -d OpenWinControls/linux/appimage/org.owc.openwincontrolscli.desktop | |
| -i OpenWinControls/linux/appimage/usr/share/icons/hicolor/256x256/apps/OpenWinControlsCLI.png | |
| --appdir OpenWinControls/AppDir | |
| --plugin checkrt | |
| --output appimage | |
| - name: upload appimage | |
| id: linux_appimg | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: OpenWinControlsCLI-x86_64 | |
| path: OpenWinControlsCLI-x86_64.AppImage | |
| retention-days: 1 | |
| publish_release: | |
| runs-on: ubuntu-latest | |
| needs: [win_release, linux_release] | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: get release artifacts | |
| uses: actions/download-artifact@main | |
| with: | |
| artifact-ids: ${{needs.win_release.outputs.win_release_pkg_id}},${{needs.linux_release.outputs.linux_owc_appimg_id}} | |
| - name: zip windows release | |
| run: zip -r -9 "OpenWinControlsCLI-Windows.zip" owc_windows | |
| - name: prepare release notes | |
| run: > | |
| echo -e "Continuous build\n\n | |
| [**Changelog**](https://github.com/OpenWinControls/OpenWinControlsCLI/blob/main/CHANGELOG.md)\n\n | |
| ### Linux\n\n | |
| Official AUR git package [here](https://aur.archlinux.org/packages/openwincontrolscli-git)" > rel_notes.md | |
| - name: remove old release | |
| env: | |
| GH_TOKEN: ${{ secrets.GTK }} | |
| GH_REPO: ${{ github.repository }} | |
| run: gh release delete continuous -y | |
| continue-on-error: true | |
| - name: publish release | |
| env: | |
| GH_TOKEN: ${{ secrets.GTK }} | |
| GH_REPO: ${{ github.repository }} | |
| run: > | |
| gh release create continuous | |
| OpenWinControlsCLI-Windows.zip | |
| OpenWinControlsCLI-x86_64/OpenWinControlsCLI-x86_64.AppImage | |
| --draft=false | |
| --latest | |
| -t "OpenWinControlsCLI" | |
| -F "rel_notes.md" |