Check for updates #7
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
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 }} | |
submodules: 'true' | |
- name: Install ruamel | |
run: | | |
pip install ruamel.yaml | |
- name: Install Flatpak | |
run: | | |
sudo apt-get install -y flatpak | |
- 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.py | |
- 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 |