Skip to content

Commit

Permalink
Create update-master-upstream GitHub Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Eloston committed Apr 26, 2021
1 parent 5aa635e commit 91c811d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/update-master-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Update master With Upstream

on:
workflow_dispatch:
inputs:
committish:
description: 'ungoogled-chromium git repo commit-ish object to update to'
required: true

jobs:
update-master-upstream:
runs-on: ubuntu-latest
env:
download-cache: build/download_cache
src: build/src
main-repo: ungoogled-chromium
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Update submodule
run: git -C ${{ env.main-repo }} switch -d "${{ github.event.inputs.committish }}"
- id: upstream_version
run: |
echo "::set-output name=chromium_version::$(cat ${{ env.main-repo }}/chromium_version.txt)"
echo "::set-output name=revision::$(cat ${{ env.main-repo }}/revision.txt)"
- run: mkdir -p ${{ env.download-cache }} ${{ env.src }}
- uses: actions/cache@v2
id: download_cache
with:
path: ${{ env.download-cache }}
key: download_cache-${{ steps.upstream_version.outputs.chromium_version }}
- name: Checkout Chromium source
run: |
./${{ env.main-repo }}/utils/downloads.py retrieve -i ${{ env.main-repo }}/downloads.ini -c ${{ env.download-cache }}
./${{ env.main-repo }}/utils/downloads.py unpack -i ${{ env.main-repo }}/downloads.ini -c ${{ env.download-cache }} ${{ env.src }}
./${{ env.main-repo }}/utils/prune_binaries.py ${{ env.src }} ${{ env.main-repo }}/pruning.list
- run: ./devutils/update_patches.sh merge
- run: sudo apt-get install -y quilt
- name: Run quilt
shell: bash
run: |
set -ex
source devutils/set_quilt_vars.sh
cd ${{ env.src }}
echo "${BASH_ALIASES[quilt]}"
set | grep QUILT
# For some reason, the "quilt" alias set in set_quilt_vars.sh is ignored. We force usage via BASH_ALIASES
${BASH_ALIASES[quilt]} push -a --refresh
- name: Cleanup repo for Pull Request
run: |
./devutils/update_patches.sh unmerge
# Delete backup files from quilt
find patches/ -name '*.patch~' -delete
- name: Reset revision
run: echo '1' >revision.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: Update to ungoogled-chromium ${{ steps.upstream_version.outputs.chromium_version }}-${{ steps.upstream_version.outputs.revision }}
body: Triggered by Actions Workflow on git commit-ish object `${{ github.event.inputs.committish }}`
commit-message: Update to ungoogled-chromium ${{ steps.upstream_version.outputs.chromium_version }}-${{ steps.upstream_version.outputs.revision }}
branch: workflows/update-master-upstream
reviewers: Eloston
6 changes: 3 additions & 3 deletions devutils/set_quilt_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export QUILT_SERIES="series.merged"
export QUILT_PUSH_ARGS="--color=auto"
export QUILT_DIFF_OPTS="--show-c-function"
export QUILT_PATCH_OPTS="--unified --reject-format=unified"
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto --sort"
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort --strip-trailing-whitespace"
export QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
export QUILT_SERIES_ARGS="--color=auto"
export QUILT_PATCHES_ARGS="--color=auto"

# When non-default less options are used, add the -R option so that less outputs
# ANSI color escape codes "raw".
[ -n "$LESS" -a -z "${QUILT_PAGER+x}" ] && export QUILT_PAGER="less -FRX"
[ -n "$LESS" -a -z "${QUILT_PAGER+x}" ] && export QUILT_PAGER="less -FRX" || true

0 comments on commit 91c811d

Please sign in to comment.