Update main-onPush.yml #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: CI for LEDSuite (build, dependency file check) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Get Dependencies and Build | |
runs-on: ubuntu-24.04 | |
steps: | |
# Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Install libadwaita dependencies | |
- name: Install Dependencies | |
run: | | |
sudo add-apt-repository 'deb https://ftp.uni-stuttgart.de/ubuntu/ oracular main' | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libadwaita-1-dev=1.6.0-1ubuntu2 \ | |
gettext \ | |
desktop-file-utils | |
# Set up JDK | |
- name: Set up JDK 23 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '23' | |
distribution: 'temurin' | |
- uses: actions/setup-python@v1 | |
# Meson Install | |
- name: Meson Install | |
uses: BSFishy/[email protected] | |
with: | |
action: install | |
setup-options: --prefix /tmp/install | |
directory: build | |
meson-version: 1.6.0 | |
ninja-version: 1.11.1.2 | |
# Generate flatpak-sources.json | |
- name: Generate flatpak-sources.json | |
run: | | |
./gradlew flatpakGradleGenerator | |
# Compare flatpak-sources.json with the one in the main branch | |
- name: Compare flatpak-sources.json | |
id: compare | |
run: | | |
git fetch origin main | |
if ! diff -u <(jq . flatpak-sources.json) <(git show origin/main:flatpak-sources.json) >/dev/null; then | |
git config --global user.email "[email protected]" | |
git config --global user.name "ToxicStoxm" | |
# Create a new branch for the PR | |
git checkout -b update-flatpak-sources | |
gh repo sync -b update-flatpak-sources | |
# Commit the changes | |
git add flatpak-sources.json | |
git commit -m "Update flatpak-sources.json" | |
# Push the changes | |
git push --set-upstream origin update-flatpak-sources | |
gh pr create -B main -H update-flatpak-sources --title 'Merge update-flatpak-sources into main' --body 'Created by Github action' | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |