Skip to content

Commit

Permalink
Introduce a daily check to bump systeminformer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Oct 16, 2024
1 parent 55e5b7a commit 9f1c16e
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Amalgamate headers
run: python amalgamate.py

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ github.sha }}
path: out/

- uses: TheMrMilchmann/setup-msvc-dev@b505cd82c5ee620766f109e9fc377c723376c877 # v2.0.1
- uses: TheMrMilchmann/setup-msvc-dev@fb19abb8a41b3cf0340f5d1be17d420309232be6 # v3.0.1
with:
arch: x64

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
dest: phnt.zip

- name: Release
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d # master 2023-08-04
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: |
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update systeminformer

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

permissions:
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Bump the systeminformer version
run: ./update.sh
shell: bash
env:
GH_TOKEN: ${{ github.token }}
32 changes: 32 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
pushd systeminformer
git fetch
git diff --exit-code HEAD origin/master -- phnt > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "[INFO] No changes to commit"
popd
exit 0
fi

NEW_HASH=$(git rev-parse --short origin/master)

echo "[INFO] Checking if bump-$NEW_HASH already exists"
git fetch
git ls-remote --exit-code --heads origin bump-$NEW_HASH > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "[INFO] Already bumped"
popd
exit 0
fi

echo "[INFO] Bumping systeminformer to $NEW_HASH"
git checkout origin/master
popd

echo "[INFO] Creating pull request"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git checkout -b bump-$NEW_HASH
git commit -am "Bump systeminformer to $NEW_HASH"
git push --set-upstream origin bump-$NEW_HASH
gh pr create --fill

0 comments on commit 9f1c16e

Please sign in to comment.