-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ad32b1
commit 0860e3c
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Check for updates | ||
|
||
on: | ||
schedule: # for scheduling to work this file must be in the default branch | ||
- cron: "0 * * * *" # run every hour | ||
workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab | ||
|
||
env: | ||
# email sets "github-actions[bot]" as commit author, see https://github.community/t/github-actions-bot-email-address/17204/6 | ||
GIT_USER_NAME: github-actions[bot] | ||
GIT_USER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | ||
FLATPAK_ID: com.artemis_rgb.Artemis | ||
|
||
jobs: | ||
flatpak-external-data-checker: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
branch: [ main ] # list all branches to check | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
|
||
- name: Check for Flatpak source updates via Flatpak External Data Checker | ||
uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest | ||
with: | ||
args: --edit-only ${{ env.FLATPAK_ID }}.yml | ||
|
||
- name: Attempt to update the Artemis git sources | ||
run: | | ||
./.github/scripts/update-manifest.py | ||
- name: Verify if git was updated | ||
id: is-updated | ||
run: | | ||
git status -s -uno | ||
[ -z "$(git status -s -uno)" ] || echo "updated=true" >> $GITHUB_OUTPUT | ||
- name: Generate dotnet sources | ||
if: steps.is-updated.outputs.updated | ||
run: | | ||
./generate-sources.sh | ||
- name: Reset Flatpak manifest to pre-modified state | ||
run: | | ||
git checkout -- ${FLATPAK_ID}.yml | ||
- name: Run the Artemis git source updates again | ||
run: | | ||
./.github/scripts/update-manifest.py | ||
- name: Run Flatpak External Data Checker again and Open PR | ||
uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest | ||
env: | ||
GIT_AUTHOR_NAME: Flatpak External Data Checker | ||
GIT_COMMITTER_NAME: Flatpak External Data Checker | ||
GIT_AUTHOR_EMAIL: ${{ env.GIT_USER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ env.GIT_USER_EMAIL }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: --update --never-fork ${{ env.FLATPAK_ID }}.yml |