-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Flatpak-CI check for all PRs #24920
Open
Flole998
wants to merge
1
commit into
xbmc:master
Choose a base branch
from
Flole998:flatpakci
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+96
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,96 @@ | ||
name: Build Flatpak CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
# auto-cancel previous runs if the pull request is force-push updated | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-flatpak: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# PR/CI | ||
- name: Checkout relevant repo | ||
uses: actions/checkout@v4 | ||
with: | ||
path: "xbmc" | ||
# Flathub config | ||
- name: Checkout Flathub config | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'flole998/tv.kodi.Kodi' | ||
submodules: true | ||
ref: "beta" | ||
path: "flathub" | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update -y | ||
DEBIAN_FRONTEND=noninteractive sudo apt-get install --force-yes -y cmake git build-essential ccache dbus-x11 flatpak | ||
- name: Grant tar root access | ||
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar | ||
- id: restore-cache | ||
name: Restore cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
/tmp/ccache | ||
flathub/.flatpak-builder | ||
/var/lib/flatpak | ||
key: flatpak-cache-${{ github.run_id }} | ||
restore-keys: | | ||
flatpak-cache | ||
- name: Remove tar root access | ||
run: sudo chmod u-s /bin/tar | ||
- name: Adjust cache permissions if cache was restored | ||
run: | | ||
sudo chmod -R 777 /tmp/ccache || true | ||
sudo chmod -R 777 flathub/.flatpak-builder || true | ||
- name: Start DBUS | ||
run: sudo service dbus start | ||
- name: Install yq | ||
run: sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq | ||
- name: Add flatpak repo | ||
run: sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | ||
- name: Install flatpak SDKs | ||
run: | | ||
sudo flatpak -y install flathub org.freedesktop.Sdk//22.08 | ||
sudo flatpak -y install flathub org.freedesktop.Platform//22.08 | ||
sudo flatpak -y install flathub org.freedesktop.Sdk.Extension.openjdk17//22.08 | ||
sudo flatpak -y install flathub org.flatpak.Builder | ||
- name: Patch flatpak build conf | ||
run: | | ||
# Remove git repo from local copy | ||
yq -i eval 'del(.modules[].sources[] | select(.type == "git" and .url == "https://github.com/xbmc/xbmc.git"))' flathub/tv.kodi.Kodi.yml | ||
# Add local git repo copy | ||
yq -i eval '(.modules[] | select(.name == "kodi") | .sources) |= [{"type": "dir", "path": "'"$GITHUB_WORKSPACE"'/xbmc"}] + .' flathub/tv.kodi.Kodi.yml | ||
# Remove addons from build | ||
yq -i 'del(.modules[] | select(. == "addons/*")) | .' flathub/tv.kodi.Kodi.yml | ||
- name: Build Kodi | ||
env: | ||
CCACHE_DIR: /tmp/ccache | ||
FLATPAKBUILDER: flatpak run org.flatpak.Builder | ||
run: cd flathub && dbus-launch make build | ||
- name: Create flatpak-file | ||
run: cd flathub && make flatpak | ||
- name: Upload flatpak-file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: flatpak | ||
path: flathub/tv.kodi.Kodi.flatpak | ||
- name: Grant tar root access | ||
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar | ||
razzeee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Save cache | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
/tmp/ccache | ||
flathub/.flatpak-builder | ||
/var/lib/flatpak | ||
key: ${{ steps.restore-cache.outputs.cache-primary-key }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'll change this before merging? Leaving a comment as a reminder