Skip to content

Commit a7b785f

Browse files
committed
perf: Personal Sync Upstream
1 parent eec3306 commit a7b785f

7 files changed

+80
-80
lines changed

.github/workflows/build_pull_request.yml

-28
This file was deleted.

.github/workflows/clean.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Delete old workflow runs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
days:
6+
description: 'Number of days.'
7+
required: true
8+
default: 0
9+
minimum_runs:
10+
description: 'The minimum runs to keep for each workflow.'
11+
required: true
12+
default: 0
13+
delete_workflow_pattern:
14+
description: 'The name of the workflow. if not set then it will target all workflows.'
15+
required: false
16+
17+
jobs:
18+
del_runs:
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- name: Delete workflow runs
22+
uses: Mattraks/delete-workflow-runs@v2
23+
with:
24+
token: ${{ github.token }}
25+
repository: ${{ github.repository }}
26+
retain_days: ${{ github.event.inputs.days }}
27+
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
28+
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}

.github/workflows/open_pull_request.yml

-26
This file was deleted.

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release
22

33
on:
4+
workflow_call:
45
workflow_dispatch:
56
push:
67
branches:

.github/workflows/sync_upstream.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Sync upstream
2+
on:
3+
workflow_call:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 */8 * * *"
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.GH_PAT }}
17+
18+
- name: sync
19+
id: sync
20+
shell: bash
21+
run: |
22+
git config --global user.name 'E85Addict'
23+
git config --global user.email '[email protected]'
24+
if [[ $(git log | grep Author | head -1) == *"semantic"* ]]; then
25+
git reset --hard HEAD~1
26+
fi
27+
T=$(git tag --sort=creatordate | tail -1)
28+
git remote add upstream https://github.com/revanced/revanced-library
29+
git tag -d $(git tag -l)
30+
git fetch upstream --tags -f
31+
LatestRemoteTag=$(curl -s https://api.github.com/repos/revanced/revanced-library/releases/latest | jq -r '.tag_name')
32+
C=$(git rev-list --left-right --count origin/main...remotes/upstream/main | awk '{print$2}')
33+
echo "Ahead $C commits."
34+
if [ "$C" -gt 0 ]; then
35+
echo "Rebasing"
36+
# git push origin --delete $T
37+
git rebase -X ours upstream/main
38+
git push --tags -f
39+
git push origin --delete $LatestRemoteTag
40+
git push -f
41+
else
42+
echo "in sync"
43+
fi
44+
45+
- name: Delete old workflow runs
46+
uses: Mattraks/delete-workflow-runs@v2
47+
with:
48+
token: ${{ github.token }}
49+
repository: ${{ github.repository }}
50+
retain_days: 0
51+
keep_minimum_runs: 10

.github/workflows/update_documentation.yml

-19
This file was deleted.

.releaserc

-7
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
]
2727
}
2828
],
29-
[
30-
"@saithodev/semantic-release-backmerge",
31-
{
32-
backmergeBranches: [{"from": "main", "to": "dev"}],
33-
clearWorkspace: true
34-
}
35-
],
3629
[
3730
"@semantic-release/github",
3831
{

0 commit comments

Comments
 (0)