Files
desktop/.github/workflows/sync-upstream.yml
mr. m 37eed5fcfe fix: Start working on more eslint rules, p=#11874
* fix: Start working on more eslint rules, b=no-bug, c=common, mods, workspaces

* chore: Continue migration, b=no-bug, c=workflows, windows, glance, mods, welcome, workspaces, common, compact-mode, folders, tests, kbs, media, split-view, tabs

* chore: Finish, b=no-bug, c=common, compact-mode, folders, glance, tests, kbs, media, mods, split-view, tabs, workspaces, welcome

* fix: Fix installing deps, b=no-bug, c=common

* feat: Dont initialize git on download checks, b=no-bug, c=workflows

* feat: Remove empty JS docs, b=no-bug, c=common, compact-mode, folders, glance, kbs, media, mods, split-view, tabs, tests, workspaces

* chore: Run lint, b=no-bug, c=common, folders, glance, kbs, mods, split-view, tabs, workspaces
2026-01-12 15:11:43 +01:00

134 lines
4.4 KiB
YAML

name: Sync Upstream Firefox Releases
on:
workflow_dispatch:
inputs:
release_candidate:
description: "Set to true to sync release candidates"
required: false
type: boolean
default: false
workflow_call:
inputs:
release_candidate:
description: "Set to true to sync release candidates"
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
check_candidates:
name: Sync Upstream
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Check if upstream branch already exists
id: check-upstream-branch
run: |
if git ls-remote --heads origin chore/upstream-sync | grep -sw "refs/heads/chore/upstream-sync" > /dev/null; then
echo "branch_exists=true" >> $GITHUB_OUTPUT
else
echo "branch_exists=false" >> $GITHUB_OUTPUT
fi
- name: Setup Node.js
uses: actions/setup-node@v4
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
with:
node-version-file: ".nvmrc"
- name: Install dependencies
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
run: npm ci
- name: Install dependencies
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
run: |
git config --global user.email "mr-cheffy@users.noreply.github.com"
git config --global user.name "mr-cheffy"
- name: Setup surfer CI
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
run: |
if [ "${{ github.event.inputs.release_candidate }}" = "false" ]; then
npm run surfer -- ci --brand release
fi
- name: Download Firefox and dependencies
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
run: npm run download
- name: Sync Upstream Releases
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
run: |
if [ "${{ github.event.inputs.release_candidate }}" = "true" ]; then
npm run sync:rc
else
npm run sync
fi
- name: Run formatter
if: steps.check-upstream-branch.outputs.branch_exists == 'false'
run: |
sudo apt install python3-autopep8
npm run pretty
- name: Check if any files changed
id: git-check
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "files_changed=true" >> $GITHUB_OUTPUT
else
echo "files_changed=false" >> $GITHUB_OUTPUT
fi
- name: Get Firefox Version
id: build-data
if: steps.git-check.outputs.files_changed == 'true'
run: |
if [ "${{ github.event.inputs.release_candidate }}" = "true" ]; then
VERSION=$(node -pe "require('./surfer.json').version.candidate")
else
VERSION=$(node -pe "require('./surfer.json').version.version")
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if patches got applied
if: steps.git-check.outputs.files_changed == 'true'
id: check-patches
continue-on-error: true
run: |
echo "Checking if patches apply cleanly..."
npm run import
- name: Import external tests
if: steps.git-check.outputs.files_changed == 'true'
run: python3 scripts/import_external_tests.py || true
- name: Create pull request
uses: peter-evans/create-pull-request@v7
if: steps.git-check.outputs.files_changed == 'true'
env:
GIT_TRACE: 1
GIT_CURL_VERBOSE: 1
with:
token: ${{ secrets.DEPLOY_KEY }}
commit-message: "chore: Sync upstream to `Firefox ${{ steps.build-data.outputs.version }}`"
branch: "chore/upstream-sync"
title: "Sync upstream Firefox to version ${{ steps.build-data.outputs.version }}"
body: |
This PR syncs the upstream Firefox to version ${{ steps.build-data.outputs.version }}.
* ${{ steps.check-patches.outcome == 'failure' && '⚠️ Some patches did not apply cleanly. Please review them carefully.' || '✅ All patches applied cleanly.' }}
@${{ github.actor }} please review and merge this PR.
base: dev
git-token: ${{ secrets.DEPLOY_KEY }}
delete-branch: true