Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Check for updates

permissions:
contents: write

on:
schedule: # for scheduling to work this file must be in the default branch
- cron: "0 * * * *" # run every hour
workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab
pull_request:
types: [opened] # temporarily enable on pull request opened to test the workflow

jobs:
update-sources:
runs-on: ubuntu-latest

steps:
- name: Checkout the noriskclient-launcher repository
uses: actions/checkout@v4
with:
repository: NoRiskClient/noriskclient-launcher
path: noriskclient-launcher

- name: Checkout this repository
uses: actions/checkout@v4
with:
path: flathub

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('flatpak-builder-tools/cargo/requirements.txt', 'flatpak-builder-tools/node/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install pip dependencies for cargo generator
run: pip install tomlkit aiohttp

- name: Checkout flatpak-builder-tools
uses: actions/checkout@v4
with:
repository: flatpak/flatpak-builder-tools
path: flatpak-builder-tools

- name: Generate cargo-sources.json
run: |
if [ -f noriskclient-launcher/src-tauri/Cargo.lock ]; then
python3 flatpak-builder-tools/cargo/flatpak-cargo-generator.py noriskclient-launcher/src-tauri/Cargo.lock -o flathub/cargo-sources.json
fi

- name: Install flatpak-node-generator
run: pipx install git+https://github.com/flatpak/flatpak-builder-tools.git#subdirectory=node

- name: Generate node-sources.json (Yarn)
run: |
if [ -f noriskclient-launcher/yarn.lock ]; then
flatpak-node-generator yarn noriskclient-launcher/yarn.lock -o flathub/node-sources.json
fi

- name: Commit changes
run: |
cd flathub
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

# Get latest version info for better commit messages
LAUNCHER_VERSION=$(cd ../noriskclient-launcher && git describe --tags --always)

FILES_TO_COMMIT=""
if [ -f cargo-sources.json ]; then
FILES_TO_COMMIT="$FILES_TO_COMMIT cargo-sources.json"
fi
if [ -f node-sources.json ]; then
FILES_TO_COMMIT="$FILES_TO_COMMIT node-sources.json"
fi

if [ -n "$FILES_TO_COMMIT" ] && [[ $(git status --porcelain $FILES_TO_COMMIT) ]]; then
git add -- $FILES_TO_COMMIT
git commit -m "chore: update flatpak dependency manifests for launcher ${LAUNCHER_VERSION}"
git push
else
echo "No changes to commit."
fi
flatpak-external-data-checker:
runs-on: ubuntu-latest

needs: update-sources

strategy:
matrix:
branch: [master, noriskclientlauncher-submission] # list all branches to check

steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}

- uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest
env:
GIT_AUTHOR_NAME: Flatpak External Data Checker
GIT_COMMITTER_NAME: Flatpak External Data Checker
# email sets "github-actions[bot]" as commit author, see https://github.community/t/github-actions-bot-email-address/17204/6
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --update --never-fork gg.norisk.NoRiskClientLauncherV3.yml
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repo/
buid-dir/
.flatpak/
.flatpak-builder/
.vscode/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "shared-modules"]
path = shared-modules
url = https://github.com/flathub/shared-modules.git
3 changes: 3 additions & 0 deletions flathub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"disable-external-data-checker": true
}
57 changes: 57 additions & 0 deletions gg.norisk.NoRiskClientLauncherV3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
id: gg.norisk.NoRiskClientLauncherV3

runtime: org.gnome.Platform
runtime-version: '48'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.node24

command: noriskclient-launcher-v3
finish-args:
- --socket=wayland
- --socket=fallback-x11
- --socket=pulseaudio
- --device=dri
- --share=ipc
- --share=network

modules:
- shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json
- name: flite
buildsystem: autotools
config-opts:
- --enable-shared
- --with-audio=pulseaudio
no-parallel-make: true
sources:
- type: git
url: https://github.com/festvox/flite.git
tag: v2.2
- name: noriskclient
buildsystem: simple
sources:
- type: git
url: https://github.com/NoRiskClient/noriskclient-launcher
tag: v0.6.8
x-checker-data:
type: git
tag-pattern: ^v([\\d.]+)$
version-scheme: semantic
is-main-source: true
- cargo-sources.json
- node-sources.json
build-options:
append-path: /usr/lib/sdk/node24/bin:/usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/noriskclient/cargo
XDG_CACHE_HOME: /run/build/noriskclient/flatpak-node/cache
YARN_YARN_OFFLINE_MIRROR: /run/build/noriskclient/flatpak-node/yarn-mirror
build-commands:
- yarn --offline
- cargo --offline fetch --manifest-path src-tauri/Cargo.toml
- yarn --offline run tauri build --no-bundle
- install -Dm755 src-tauri/target/release/noriskclient-launcher-v3 /app/bin/noriskclient-launcher-v3
- install -Dm644 packaging/gg.norisk.NoRiskClientLauncherV3.desktop /app/share/applications/gg.norisk.NoRiskClientLauncherV3.desktop
- install -Dm644 src-tauri/icons/128x128@2x.png /app/share/icons/hicolor/256x256/apps/gg.norisk.NoRiskClientLauncherV3.png
- install -Dm644 packaging/gg.norisk.NoRiskClientLauncherV3.metainfo.xml /app/share/metainfo/gg.norisk.NoRiskClientLauncherV3.metainfo.xml
1 change: 1 addition & 0 deletions shared-modules
Submodule shared-modules added at b63062
Loading