mirror of
https://github.com/aimok04/kitshn.git
synced 2025-12-19 21:16:23 +01:00
github(workflows): added "Build flatpak on new version tag" workflow
Some checks failed
Deploy Nightly / Deploy nightly (push) Has been cancelled
Some checks failed
Deploy Nightly / Deploy nightly (push) Has been cancelled
This commit is contained in:
67
.github/workflows/dist_flatpak.yml
vendored
Normal file
67
.github/workflows/dist_flatpak.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
name: Build flatpak on new version tag
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
flatpak:
|
||||
name: "Build and release flatpak"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
|
||||
options: --privileged
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x86_64, aarch64]
|
||||
# Don't fail the whole workflow if one architecture fails
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Install deps
|
||||
if: ${{ matrix.arch != 'x86_64' }}
|
||||
run: |
|
||||
# Use the static binaries because it's unable to use a package manager
|
||||
curl https://download.docker.com/linux/static/stable/x86_64/docker-26.0.0.tgz --output ./docker.tgz
|
||||
tar xzvf docker.tgz
|
||||
mv docker/* /usr/bin
|
||||
- name: Set up QEMU
|
||||
if: ${{ matrix.arch != 'x86_64' }}
|
||||
id: qemu
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build appImage
|
||||
run: ./gradlew packageAppImage
|
||||
|
||||
- name: Copy appImage
|
||||
run: cp -r composeApp/build/compose/binaries/main/app/kitshn flatpak/source
|
||||
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||
with:
|
||||
bundle: kitshn-${{ matrix.arch }}-${{ github.sha }}.flatpak
|
||||
manifest-path: flatpak/app.kitshn.kitshn.yml
|
||||
cache-key: flatpak-builder-${{ matrix.arch }}-${{ github.sha }}
|
||||
arch: ${{ matrix.arch }}
|
||||
upload-artifact: false
|
||||
|
||||
- name: Release artifacts
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: github.ref_type == 'tag'
|
||||
with:
|
||||
files: kitshn-${{ matrix.arch }}-${{ github.sha }}.flatpak
|
||||
Reference in New Issue
Block a user