diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 0000000..faf784d --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,34 @@ +on: + push: + tags: ['v*.*.*', 'v*.*.*-*'] + workflow_dispatch: +name: Flatpak +jobs: + flatpak: + name: "Flatpak" + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-45 + options: --privileged + steps: + - name: "Free up disk space" + run: | + sudo rm -rf /usr/share/dotnet >/dev/null 2>&1 + sudo rm -rf /opt/ghc >/dev/null 2>&1 + sudo rm -rf "/usr/local/share/boost" >/dev/null 2>&1 + sudo rm -rf "$AGENT_TOOLSDIRECTORY" >/dev/null 2>&1 + sudo rm -rf /usr/local/lib/android >/dev/null 2>&1 + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + manifest-path: dev.casraf.StimVisor.yml + cache-key: flatpak-builder-${{ github.sha }} + bundle: StimVisor.flatpak + # - name: "Add to release" + # uses: softprops/action-gh-release@v2 + # with: + # files: | + # StimVisor.flatpak + # /__w/stimvisor/stimvisor/flatpak_app/files/bin/stimvisor diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1e7a990 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "shared-modules"] + path = shared-modules + url = https://github.com/flathub/shared-modules.git diff --git a/dev.casraf.StimVisor.yml b/dev.casraf.StimVisor.yml new file mode 100644 index 0000000..1bdfdf3 --- /dev/null +++ b/dev.casraf.StimVisor.yml @@ -0,0 +1,59 @@ +id: dev.casraf.StimVisor +runtime: org.gnome.Platform +runtime-version: '3.38' +sdk: org.gnome.Sdk +command: stimvisor + +finish-args: + - --share=ipc # Share IPC namespace with the host (necessary for X11). + - --socket=x11 + - --socket=wayland + - --socket=fallback-x11 + - --device=dri # OpenGL rendering support. + # - --talk-name=org.freedesktop.Notifications + - --filesystem=home + - --filesystem=host + - --share=network + # - --talk-name=org.kde.StatusNotifierWatcher + +build-options: + build-args: + - --share=network + env: + - GOROOT=/app/sdk/golang + - GOBIN=/app/go/bin + - CGO_ENABLED=0 + - NODEROOT=/app/sdk/node + +modules: + - name: golang + buildsystem: simple + build-commands: + - mkdir -p $GOROOT + - mv $(pwd)/* $GOROOT + sources: + - type: archive + url: https://go.dev/dl/go1.22.1.linux-amd64.tar.gz + sha256: aab8e15785c997ae20f9c88422ee35d962c4562212bb0f879d052a35c8307c7f + - name: nodejs + buildsystem: simple + build-commands: + - mkdir -p $NODEROOT + - mv $(pwd)/* $NODEROOT + - PATH=$PATH:$NODEROOT/bin npm i -g pnpm + sources: + - type: archive + url: https://nodejs.org/dist/v21.7.1/node-v21.7.1-linux-x64.tar.xz + sha256: cb25d7a4aa57d15f280ce45cd72f95e9d2020702b7ca75c7fe632444f7c0452c + - name: wails + buildsystem: simple + build-commands: + - $GOROOT/bin/go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: stimvisor + buildsystem: simple + sources: + - type: dir + path: . + build-commands: + - PATH=$PATH:$GOROOT/bin:$NODEROOT/bin:$GOBIN wails build -ldflags="-X main.Version=0.0.1 -X main.Build=$(date +%FT%T%z)" + - install -Dm755 build/bin/stimvisor $FLATPAK_DEST/bin/stimvisor diff --git a/shared-modules b/shared-modules new file mode 160000 index 0000000..c02819d --- /dev/null +++ b/shared-modules @@ -0,0 +1 @@ +Subproject commit c02819d1e62e5189f5797df40711a5c67915fe8a