Skip to content

Commit 7a26542

Browse files
committed
add ci
1 parent 0a5fd66 commit 7a26542

3 files changed

Lines changed: 126 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- '*'
7+
paths:
8+
- 'android/**'
79
workflow_dispatch:
810
inputs:
911
release:
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Linux Build & Release
2+
3+
on:
4+
push:
5+
branches:
6+
- linux/rust
7+
tags:
8+
- 'linux-v*'
9+
paths:
10+
- 'linux-rust/**'
11+
- '.github/workflows/linux-build.yml'
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y pkg-config libdbus-1-dev libpulse-dev appstream just libfuse2
25+
26+
- name: Install AppImage tools
27+
run: |
28+
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
29+
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O /usr/local/bin/linuxdeploy
30+
chmod +x /usr/local/bin/{appimagetool,linuxdeploy}
31+
32+
- name: Install Rust
33+
uses: dtolnay/rust-toolchain@stable
34+
35+
- name: Cache Cargo
36+
uses: actions/cache@v4
37+
with:
38+
path: |
39+
~/.cargo/registry
40+
~/.cargo/git
41+
linux-rust/target
42+
key: ${{ runner.os }}-cargo-${{ hashFiles('linux-rust/Cargo.lock') }}
43+
44+
- name: Build AppImage and Binary
45+
working-directory: linux-rust
46+
run: |
47+
cargo build --release --verbose
48+
just
49+
mkdir -p dist
50+
cp target/release/librepods dist/librepods
51+
mv dist/LibrePods-x86_64.AppImage dist/librepods-x86_64.AppImage
52+
53+
- name: Upload AppImage artifact
54+
if: "!startsWith(github.ref, 'refs/tags/linux-v')"
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: librepods-x86_64.AppImage
58+
path: linux-rust/dist/librepods-x86_64.AppImage
59+
60+
- name: Upload binary artifact
61+
if: "!startsWith(github.ref, 'refs/tags/linux-v')"
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: librepods
65+
path: linux-rust/dist/librepods
66+
67+
- name: Create tarball for Flatpak
68+
if: startsWith(github.ref, 'refs/tags/linux-v')
69+
working-directory: linux-rust
70+
run: |
71+
VERSION="${GITHUB_REF_NAME#linux-v}"
72+
just tarball "${VERSION}"
73+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
74+
echo "TAR_PATH=linux-rust/dist/librepods-v${VERSION}-source.tar.gz" >> $GITHUB_ENV
75+
76+
- name: Create GitHub Release (AppImage + binary + source)
77+
if: startsWith(github.ref, 'refs/tags/linux-v')
78+
uses: softprops/action-gh-release@v2
79+
with:
80+
tag_name: ${{ github.ref_name }}
81+
files: |
82+
linux-rust/dist/librepods-v${{ env.VERSION }}-source.tar.gz
83+
linux-rust/dist/librepods-x86_64.AppImage
84+
linux-rust/dist/librepods
85+
generate_release_notes: true
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-linux.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build LibrePods Linux
2+
3+
on:
4+
workflow_dispatch:
5+
# push:
6+
# branches:
7+
# - '*'
8+
9+
jobs:
10+
build-linux:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Install dependencies
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y build-essential cmake ninja-build \
21+
qt6-base-dev qt6-declarative-dev qt6-svg-dev \
22+
qt6-tools-dev qt6-tools-dev-tools qt6-connectivity-dev \
23+
libxkbcommon-dev
24+
25+
- name: Build project
26+
working-directory: linux
27+
run: |
28+
mkdir build
29+
cd build
30+
cmake .. -G Ninja
31+
ninja
32+
33+
- name: Upload artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: librepods-linux
37+
path: linux/build/librepods

0 commit comments

Comments
 (0)