Skip to content

Commit

Permalink
Add update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
USA-RedDragon committed Dec 4, 2023
1 parent 558fc18 commit 8ae0b98
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 10 deletions.
8 changes: 0 additions & 8 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,5 @@
"# renovate: sha: datasource=(?<datasource>.*?)(?:\\s+extractVersion=(?<extractVersion>.+?))?\\s+depName=(?<depName>.+?)?\\s+packageName=(?<packageName>.+?)?\\s+branch=(?<currentValue>.+?)?\\s(?:\\s*.*_(?:sha|SHA)[:=]\\s*(?<currentDigest>.*))?"
]
}
],
"packageRules": [
{
"matchPackagePatterns": [
"^debian$"
],
"allowedVersions": "<=11"
}
]
}
23 changes: 23 additions & 0 deletions .github/workflows/autorebase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Stale PR Auto-rebaser

on:
workflow_dispatch:

push:
branches-ignore:
- rebase-pull-request**
- cherry-pick-rebase-pull-request**

pull_request:
types: [labeled]

jobs:
auto-rebase:
runs-on: ubuntu-latest
permissions:
contents: read
name: AutoRebase
steps:
- uses: Label305/AutoRebase@v0.1
with:
github_token: ${{ secrets.PAT }}
2 changes: 0 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ jobs:
./build.sh sign
- name: Push Flatpak repository
run: |
git config --global user.name "GitHub Actions"
git config --global user.email 'bot@noreply.github.com'
cd repo
git add -A
git commit --signoff -m "Update com.jagex.Launcher"
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Check for updates

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Setup GPG
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get update -y
sudo apt-get install --no-install-recommends -y yq
- name: Check for updates
run: |
bash ./update.sh
- name: Check if there are any changes
id: check-changes
run: |
# Check git status --porcelain
if [[ -z $(git status --porcelain) ]]; then
echo "No changes detected"
echo "CHANGES=false" >> $GITHUB_OUTPUTS
else
echo "Changes detected"
echo "CHANGES=true" >> $GITHUB_OUTPUTS
fi
- name: Commit changes
if: steps.check-changes.outputs.CHANGES == 'true'
run: |
git add -A
git commit --signoff -m "Update Flatpak dependencies"
env:
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
id: cpr
if: steps.check-changes.outputs.CHANGES == 'true'
with:
token: ${{ secrets.PAT }}
branch: automated/flatpak-update
delete-branch: true
title: Update Flatpak dependencies
body: Automated update to Flatpak dependencies
labels: |
update
chore
automated pr
autorebase:opt-in
- name: Automerge Pull Request
if: steps.check-changes.outputs.CHANGES && 'true' ** (steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated')
run: gh pr merge --rebase --auto "$PR_NUMBER"
env:
GH_TOKEN: ${{ secrets.PAT }}
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}

0 comments on commit 8ae0b98

Please sign in to comment.