Merge pull request #12 from utajum/fix/gpu-safety-guards-boot-service #70
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 | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| # Allow manual trigger from GitHub Actions UI | |
| permissions: | |
| contents: write | |
| jobs: | |
| # First job: determine the version | |
| version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_version: ${{ steps.version.outputs.new_version }} | |
| steps: | |
| - name: Get latest release version from GitHub API | |
| id: version | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Use GitHub API to get the latest release | |
| # gh release view exits non-zero if no releases exist | |
| LATEST_RELEASE="" | |
| if gh release view --repo ${{ github.repository }} --json tagName -q '.tagName' > /tmp/latest_tag 2>/dev/null; then | |
| LATEST_RELEASE=$(cat /tmp/latest_tag) | |
| fi | |
| echo "Latest release: '${LATEST_RELEASE}'" | |
| if [ -z "$LATEST_RELEASE" ] || ! echo "$LATEST_RELEASE" | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| NEW_VERSION="v1.0.0" | |
| else | |
| VERSION=${LATEST_RELEASE#v} | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" | |
| NEW_PATCH=$((PATCH + 1)) | |
| NEW_VERSION="v${MAJOR}.${MINOR}.${NEW_PATCH}" | |
| fi | |
| echo "New version: $NEW_VERSION" | |
| echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT | |
| # Build the native AOT binary | |
| build: | |
| needs: [version] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Patch version in .csproj | |
| run: | | |
| VERSION=${{ needs.version.outputs.new_version }} | |
| VERSION=${VERSION#v} | |
| sed -i "s|<Version>.*</Version>|<Version>${VERSION}</Version>|" src/GHelper.Linux.csproj | |
| echo "Updated .csproj version to: ${VERSION}" | |
| grep "<Version>" src/GHelper.Linux.csproj | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0' | |
| - name: Install Native AOT dependencies | |
| run: sudo apt-get update && sudo apt-get install -y clang zlib1g-dev | |
| - name: Restore packages | |
| run: dotnet restore src/ --runtime linux-x64 | |
| - name: Publish Native AOT binary | |
| run: dotnet publish src/ -c Release --no-restore | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ghelper | |
| path: src/bin/Release/net8.0/linux-x64/publish/ghelper | |
| - name: Upload native libs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-libs | |
| path: | | |
| src/bin/Release/net8.0/linux-x64/publish/libSkiaSharp.so | |
| src/bin/Release/net8.0/linux-x64/publish/libHarfBuzzSharp.so | |
| # Build AppImage from compiled artifacts | |
| appimage: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download binary artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ghelper | |
| path: artifacts/ghelper | |
| - name: Download native libs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: native-libs | |
| path: artifacts/native-libs | |
| - name: Install libfuse2 | |
| run: sudo apt-get update && sudo apt-get install -y libfuse2 | |
| - name: Download appimagetool | |
| run: | | |
| curl -fsSL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" \ | |
| -o appimagetool | |
| chmod +x appimagetool | |
| - name: Assemble AppDir | |
| run: | | |
| mkdir -p GHelper.AppDir/usr/bin | |
| # Binary + native libs next to binary (NativeLibExtractor finds them here) | |
| cp artifacts/ghelper/ghelper GHelper.AppDir/usr/bin/ | |
| cp artifacts/native-libs/libSkiaSharp.so GHelper.AppDir/usr/bin/ | |
| cp artifacts/native-libs/libHarfBuzzSharp.so GHelper.AppDir/usr/bin/ | |
| chmod +x GHelper.AppDir/usr/bin/ghelper | |
| # Desktop entry at AppDir root (required by appimagetool) | |
| cp install/ghelper.desktop GHelper.AppDir/ghelper.desktop | |
| # Icon at AppDir root (must match Icon= in .desktop file) | |
| cp install/ghelper.png GHelper.AppDir/ghelper.png | |
| # AppRun entry point | |
| printf '#!/bin/bash\nHERE="$(dirname "$(readlink -f "$0")")"\nexec "$HERE/usr/bin/ghelper" "$@"\n' > GHelper.AppDir/AppRun | |
| chmod +x GHelper.AppDir/AppRun | |
| - name: Build AppImage | |
| run: | | |
| export ARCH=x86_64 | |
| ./appimagetool GHelper.AppDir GHelper-x86_64.AppImage | |
| - name: Upload AppImage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: appimage | |
| path: GHelper-x86_64.AppImage | |
| # Create release with all artifacts | |
| release: | |
| needs: [version, build, appimage] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare release files | |
| run: | | |
| mkdir -p release | |
| cp artifacts/ghelper/ghelper release/ | |
| cp artifacts/native-libs/libSkiaSharp.so release/ | |
| cp artifacts/native-libs/libHarfBuzzSharp.so release/ | |
| cp artifacts/appimage/GHelper-x86_64.AppImage release/ | |
| chmod +x release/ghelper | |
| chmod +x release/GHelper-x86_64.AppImage | |
| ls -la release/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.version.outputs.new_version }} | |
| name: Release ${{ needs.version.outputs.new_version }} | |
| body: | | |
| ## G-Helper Linux ${{ needs.version.outputs.new_version }} | |
|  | |
|  | |
| ASUS laptop control utility for Linux — native AOT binary, no runtime needed. | |
| ### Quick Install | |
| ```bash | |
| curl -sL https://raw.githubusercontent.com/${{ github.repository }}/master/install/install.sh | sudo bash | |
| ``` | |
| ### AppImage | |
| Download `GHelper-x86_64.AppImage`, make it executable, and run: | |
| ```bash | |
| chmod +x GHelper-x86_64.AppImage | |
| ./GHelper-x86_64.AppImage | |
| ``` | |
| ### Manual Install | |
| Download all 3 files, place them in the same directory, and run: | |
| | File | Description | | |
| |------|-------------| | |
| | `ghelper` | Main binary | | |
| | `libSkiaSharp.so` | Skia graphics library | | |
| | `libHarfBuzzSharp.so` | HarfBuzz text shaping library | | |
| ```bash | |
| chmod +x ghelper | |
| ./ghelper | |
| ``` | |
| > **Note:** udev rules are required for hardware access without root. The quick install script handles this automatically. For AppImage or manual installs: | |
| > | |
| > ```bash | |
| > sudo curl -sL https://raw.githubusercontent.com/${{ github.repository }}/master/install/90-ghelper.rules -o /etc/udev/rules.d/90-ghelper.rules | |
| > sudo udevadm control --reload-rules && sudo udevadm trigger | |
| > ``` | |
| --- | |
| *Auto-generated release from commit ${{ github.sha }}* | |
| files: | | |
| release/ghelper | |
| release/libSkiaSharp.so | |
| release/libHarfBuzzSharp.so | |
| release/GHelper-x86_64.AppImage | |
| generate_release_notes: true |