diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e78ad39..fd1812a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -19,12 +19,12 @@ jobs: 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 @@ -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: | diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..27d9fd9 --- /dev/null +++ b/.github/workflows/update.yml @@ -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 }} diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..7c498ec --- /dev/null +++ b/update.sh @@ -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