Skip to content

Hide Cineby settings behind launcher #67

Hide Cineby settings behind launcher

Hide Cineby settings behind launcher #67

Workflow file for this run

name: Build Userscripts
on:
push:
branches: [main]
paths:
- 'scripts/**/src/**'
- 'build.js'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.github/workflows/build.yml'
pull_request:
branches: [main]
paths:
- 'scripts/**/src/**'
- 'build.js'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.github/workflows/build.yml'
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Full history needed so the commit step can push back
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
# On direct pushes to main, commit the compiled dist files back to the repo
# so raw.githubusercontent.com URLs always serve the latest build.
- name: Commit built files
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add scripts/*/dist/*.user.js
# Only commit if there are actual changes to dist
if ! git diff --staged --quiet; then
git commit -m "build: compile userscripts [skip ci]"
git push
fi