Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/app-preset.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: App launch preset
description: Request one Sunshine launch option for a non-game app.
description: Request one launch option for a non-game app.
title: '[APP PRESET]: '
labels:
- request-app-preset
Expand All @@ -9,7 +9,7 @@ body:
attributes:
value: |
Apps have no GameDB record. A maintainer reviews the official URL and command before approval.
Submit one host OS and command per issue. The preset name is generated from the app name and OS.
Submit one host OS and command per issue. The preset name is the app name; the host OS is shown separately.
- type: input
id: app_name
attributes:
Expand Down Expand Up @@ -52,7 +52,7 @@ body:
id: working_dir
attributes:
label: Working directory
description: Optional Sunshine working-dir value.
description: Optional working directory.
- type: textarea
id: notes
attributes:
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/game-emulator.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Emulator game preset
description: Request a Sunshine Emulator launch option for a GameDB game.
description: Request an emulator launch option for a GameDB game.
title: '[EMULATOR GAME PRESET]: '
labels:
- request-game-preset
Expand Down Expand Up @@ -28,7 +28,7 @@ body:
attributes:
label: Command
description: |
Portable Sunshine command for the emulator. Use {{ROM_PATH}} for the game and
Portable command for the emulator. Use {{ROM_PATH}} for the game and
{{HOME}} for a variable home path. Put the emulator executable on the host PATH.
Windows-only path placeholders, literal home directories, and reserved system names are rejected.
validations:
Expand All @@ -37,7 +37,7 @@ body:
id: working_dir
attributes:
label: Working directory
description: Optional portable Sunshine working-dir value.
description: Optional portable working directory.
- type: textarea
id: notes
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/game-epic-games.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Epic Games game preset
description: Request a Sunshine Epic Games launch option for a GameDB game.
description: Request an Epic Games launch option for a GameDB game.
title: '[EPIC GAMES GAME PRESET]: '
labels:
- request-game-preset
Expand All @@ -25,7 +25,7 @@ body:
description: |
Three-part Sandbox ID, Catalog ID, and Artifact ID from the Epic launcher shortcut,
separated by colons or %3A. For example fn%3A4fe75bbc5a674f4f9b356b5c90567da5%3AFortnite.
The bot generates the Sunshine command for each supported launcher OS.
The bot generates the command for each supported launcher OS.
validations:
required: true
- type: textarea
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/game-gog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: GOG game preset
description: Request a Sunshine GOG launch option for a GameDB game.
description: Request a GOG launch option for a GameDB game.
title: '[GOG GAME PRESET]: '
labels:
- request-game-preset
Expand Down Expand Up @@ -33,7 +33,7 @@ body:
attributes:
label: Command
description: |
Sunshine command to launch the game. Use {{HOME}} for a variable home path.
Command to launch the game. Use {{HOME}} for a variable home path.
Windows also allows {{SYSTEM_DRIVE}}, {{PROGRAM_FILES}}, and {{PROGRAM_FILES_X86}}.
Literal home directories and reserved system names are rejected.
validations:
Expand All @@ -42,7 +42,7 @@ body:
id: working_dir
attributes:
label: Working directory
description: Optional Sunshine working-dir value.
description: Optional working directory.
- type: textarea
id: notes
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/game-microsoft-store.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Microsoft Store game preset
description: Request a Sunshine Microsoft Store launch option for a GameDB game.
description: Request a Microsoft Store launch option for a GameDB game.
title: '[MICROSOFT STORE GAME PRESET]: '
labels:
- request-game-preset
Expand All @@ -25,7 +25,7 @@ body:
description: |
Installed app AUMID from Get-StartApps, for example
Microsoft.WindowsCalculator_8wekyb3d8bbwe!App. A Store product ID will not launch the game.
The bot generates the Sunshine command for each supported launcher OS.
The bot generates the command for each supported launcher OS.
validations:
required: true
- type: textarea
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/game-native.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Native game preset
description: Request a Sunshine Native launch option for a GameDB game.
description: Request a native launch option for a GameDB game.
title: '[NATIVE GAME PRESET]: '
labels:
- request-game-preset
Expand Down Expand Up @@ -33,7 +33,7 @@ body:
attributes:
label: Command
description: |
Sunshine command to launch the game. Use {{HOME}} for a variable home path.
Command to launch the game. Use {{HOME}} for a variable home path.
Windows also allows {{SYSTEM_DRIVE}}, {{PROGRAM_FILES}}, and {{PROGRAM_FILES_X86}}.
Literal home directories and reserved system names are rejected.
validations:
Expand All @@ -42,7 +42,7 @@ body:
id: working_dir
attributes:
label: Working directory
description: Optional Sunshine working-dir value.
description: Optional working directory.
- type: textarea
id: notes
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/game-steam.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Steam game preset
description: Request a Sunshine Steam launch option for a GameDB game.
description: Request a Steam launch option for a GameDB game.
title: '[STEAM GAME PRESET]: '
labels:
- request-game-preset
Expand All @@ -24,7 +24,7 @@ body:
label: Launch ID
description: |
Steam numeric app ID from its store URL, for example 464920.
The bot generates the Sunshine command for each supported launcher OS.
The bot generates the command for each supported launcher OS.
validations:
required: true
- type: textarea
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Preview database migrations
if: github.event_name == 'pull_request'
shell: bash
run: |
set -euo pipefail
source_commit=$(git -C database-branch rev-parse HEAD)
node src/migrate-database.js --database database-branch/database \
--backup-branch "database-backup-$source_commit" --source-commit "$source_commit"

- name: Assemble site
run: node src/build-site.js --database database-branch/database --output site-build

Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/check-preset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ jobs:
EVENT_FILE: ${{ github.event_path }}
TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }}
TWITCH_CLIENT_SECRET: ${{ secrets.TWITCH_CLIENT_SECRET }}
run: node src/issue.js --event "$EVENT_FILE" --database database-branch/database --mode check --report report.md
run: |
node src/issue.js --event "$EVENT_FILE" --database database-branch/database \
--mode check --report report.md --title-output issue-title.txt

- name: Post result
if: always() && hashFiles('report.md') != ''
Expand All @@ -62,6 +64,22 @@ jobs:
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: gh issue comment "$ISSUE_NUMBER" --body-file report.md

- name: Update issue title
if: steps.validate.outcome == 'success'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ github.token }}
script: |
const fs = require('node:fs')
const title = fs.readFileSync('issue-title.txt', 'utf8').trim()
if (context.payload.issue.title !== title) {
await github.rest.issues.update({
...context.repo,
issue_number: context.issue.number,
title
})
}

- name: Queue trusted game submission
if: steps.validate.outcome == 'success' && contains(github.event.issue.labels.*.name, 'request-game-preset')
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/migrate-database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
name: Migrate Database
permissions: {}

env:
NODE_VERSION: '24'

on:
push:
branches:
- master
workflow_dispatch:

concurrency:
group: database-migrations
cancel-in-progress: false

jobs:
migrate:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Checkout database
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: database
path: database-branch
token: ${{ secrets.GH_BOT_TOKEN }}
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}

- name: Back up and migrate database
id: migrate
env:
BOT_NAME: ${{ vars.GH_BOT_NAME }}
BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
shell: bash
run: |
set -euo pipefail
git -C database-branch config user.name "$BOT_NAME"
git -C database-branch config user.email "$BOT_EMAIL"
for _ in 1 2 3 4 5; do
git -C database-branch fetch origin database
git -C database-branch reset --hard origin/database
pending=$(node src/migrate-database.js --database database-branch/database --pending)
if [[ -z "$pending" ]]; then
echo 'No pending database migrations'
exit 0
fi
source_commit=$(git -C database-branch rev-parse HEAD)
backup_branch="database-backup-$source_commit"
backup_remote=$(git -C database-branch ls-remote origin "refs/heads/$backup_branch" | cut -f1)
if [[ -z "$backup_remote" ]]; then
git -C database-branch push origin "$source_commit:refs/heads/$backup_branch"
elif [[ "$backup_remote" != "$source_commit" ]]; then
echo "Backup branch $backup_branch does not match $source_commit" >&2
exit 1
fi
node src/migrate-database.js --database database-branch/database \
--backup-branch "$backup_branch" --source-commit "$source_commit"
git -C database-branch add database
if git -C database-branch diff --cached --quiet; then
echo 'A pending migration produced no database changes' >&2
exit 1
fi
git -C database-branch commit -m 'chore: apply database migrations'
if git -C database-branch push origin HEAD:database; then
echo 'migrated=true' >> "$GITHUB_OUTPUT"
exit 0
fi
done
echo 'Database changed during all five migration attempts' >&2
exit 1

- name: Build updated site
if: steps.migrate.outputs.migrated == 'true'
env:
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
run: gh workflow run build-pages.yml --ref master
Loading
Loading