diff --git a/.gitea/ci.yml b/.gitea/ci.yml new file mode 100644 index 0000000..d10a9f7 --- /dev/null +++ b/.gitea/ci.yml @@ -0,0 +1,60 @@ +on: + push: + branches: [main] + pull_request: + +name: CI + +jobs: + rustfmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - name: Create blank versions of configured file + run: echo -e "" >> src/config.rs + - name: Run cargo fmt + run: cargo fmt --all -- --check + + flatpak: + runs-on: ubuntu-latest + steps: + - name: Checkout source + run: | + git clone ${{ gitea.server_url }}/${{ gitea.repository }} . + git checkout ${{ gitea.sha }} + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y flatpak flatpak-builder xserver-xorg-video-dummy xvfb + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + - name: Install SDK + run: | + flatpak install -y flathub org.freedesktop.Sdk/x86_64/48 org.freedesktop.Sdk.Extension.rust-stable/x86_64/48 org.freedesktop.Sdk.Extension.llvm18/x86_64/18 org.gnome.Platform/x86_64/48 + - name: Build Flatpak + run: | + xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \ + flatpak-builder \ + --repo=repo \ + --force-clean \ + --install-deps-from=flathub \ + --default-branch=master \ + --arch=x86_64 \ + build-dir \ + build-aux/com.ranfdev.Notify.Devel.json + - name: Bundle Flatpak + run: flatpak build-bundle repo notify.flatpak com.ranfdev.Notify.Devel + - name: Upload artifact + run: | + curl -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -F "file=@notify.flatpak" \ + ${GITEA_SERVER_URL}/api/packages/${GITEA_REPOSITORY_OWNER}/generic/notify/latest/notify.flatpak diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3918d97..dbc904d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,8 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - name: Checkout source - uses: actions/checkout@v4 - - name: Setup Rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable @@ -25,35 +23,17 @@ jobs: run: cargo fmt --all -- --check flatpak: + name: Flatpak runs-on: ubuntu-latest container: image: bilelmoussaoui/flatpak-github-actions:gnome-nightly - options: --privileged --device=/dev/fuse + options: --privileged steps: - - name: Install git - run: dnf install -y git - - name: Checkout source - run: | - git clone ${{ gitea.server_url }}/${{ gitea.repository }} . - git checkout ${{ gitea.sha }} - - name: Build Flatpak - run: | - xvfb-run --auto-servernum \ - flatpak-builder \ - --repo=repo \ - --force-clean \ - --no-rofiles-fuse \ - --install-deps-from=flathub \ - --default-branch=master \ - --arch=x86_64 \ - --ccache \ - build-dir \ - build-aux/com.ranfdev.Notify.Devel.json - - name: Bundle Flatpak - run: flatpak build-bundle repo notify.flatpak ink.unbl.notify.Devel - - name: Upload artifact - run: | - curl -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -F "file=@notify.flatpak" \ - ${GITEA_SERVER_URL}/api/packages/${GITEA_REPOSITORY_OWNER}/generic/notify/latest/notify.flatpak + - uses: actions/checkout@v3 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: notify.flatpak + manifest-path: build-aux/ink.unbl.Notify.Devel.json + repository-name: "flathub" + run-tests: true + cache-key: flatpak-builder-${{ github.sha }}