-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from ToxicStoxm/CI-CD-Fixes
Ci cd fixes
- Loading branch information
Showing
4 changed files
with
151 additions
and
123 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,76 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
setup: | ||
name: Environment Setup | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
# Step 1: Checkout the code | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Ensure we get the full history if needed | ||
|
||
# Step 2: Add custom repository for dependencies | ||
- name: Add Custom Repository | ||
run: | | ||
sudo add-apt-repository 'deb https://ftp.uni-stuttgart.de/ubuntu/ oracular main' | ||
sudo apt-get update | ||
# Step 3: Install required dependencies | ||
- name: Install System Dependencies | ||
run: | | ||
sudo apt-get install -y \ | ||
libadwaita-1-dev=1.6.0-1ubuntu2 \ | ||
gettext \ | ||
desktop-file-utils | ||
setup-tools: | ||
name: Setup Build Tools | ||
runs-on: ubuntu-24.04 | ||
needs: setup # Depends on the 'setup' job | ||
|
||
steps: | ||
# Step 1: Checkout code again if required | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Set up Java Development Kit | ||
- name: Set up JDK 23 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '23' | ||
distribution: 'temurin' | ||
|
||
# Step 3: Set up Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
|
||
build: | ||
name: Build and Install with Meson | ||
runs-on: ubuntu-24.04 | ||
needs: [setup, setup-tools] # Depends on the previous jobs | ||
|
||
steps: | ||
# Step 1: Checkout code again if needed | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Run the Meson Build Action | ||
- name: Install and Build with Meson | ||
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,75 @@ | ||
name: Update Flatpak Sources | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
setup-environment: | ||
name: Setup Environment | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
# Step 1: Checkout the code | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Set up Java Development Kit (JDK) | ||
- name: Set up JDK 23 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '23' | ||
distribution: 'temurin' | ||
|
||
generate-flatpak-sources: | ||
name: Generate Flatpak Sources | ||
runs-on: ubuntu-24.04 | ||
needs: setup-environment # Ensures environment setup is completed | ||
|
||
steps: | ||
# Step 1: Checkout the code (again, if necessary) | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Generate flatpak-sources.json | ||
- name: Generate flatpak-sources.json | ||
run: ./gradlew flatpakGradleGenerator | ||
|
||
compare-and-sync: | ||
name: Compare and Update Flatpak Sources | ||
runs-on: ubuntu-24.04 | ||
needs: generate-flatpak-sources # Ensures the sources file is generated | ||
|
||
steps: | ||
# Step 1: Checkout the code | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Compare flatpak-sources.json and create PR if needed | ||
- name: Compare and Sync 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 update | ||
git checkout -b update-flatpak-sources | ||
# Synchronize repository to prevent conflicts | ||
gh repo sync -b update-flatpak-sources | ||
# Stage and commit changes | ||
git add flatpak-sources.json | ||
git commit -m "Update flatpak-sources.json" | ||
# Push changes to the remote repository | ||
git push --set-upstream origin update-flatpak-sources | ||
# Create a pull request | ||
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 }} |