Skip to content

misc cleanup and bug fixes #761

misc cleanup and bug fixes

misc cleanup and bug fixes #761

Workflow file for this run

name: build-flatpak
on:
push:
tags:
- 'v*'
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build-flatpak:
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10
options: --privileged
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: Get Git tag description and architecture
id: git_info
run: |
git config --global --add safe.directory $(pwd)
VERSION=$(git tag --points-at HEAD | grep -v '^beta$' | sed 's/^v//' | head -n 1 || true)
VERSION=${VERSION:-$(git describe --tags --always --long --exclude beta | sed 's/^v//' || true)}
VERSION=${VERSION:-$(cat MMAPPER_VERSION)}
ARCHITECTURE=$(uname -m)
FILE="org.mume.MMapper-${VERSION}-Linux-${ARCHITECTURE}.flatpak"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "ARCHITECTURE=${ARCHITECTURE}" >> $GITHUB_ENV
echo "FILE=${FILE}" >> $GITHUB_ENV
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: "${{ env.FILE }}"
manifest-path: "org.mume.MMapper.json"
upload-artifact: false
- name: Generate SHA256 checksum
run: |
sha256sum ${{ env.FILE }} > ${{ env.FILE }}.sha256
mkdir -p artifact
mv *.flatpak* artifact
- name: Get Linux package file base name
id: get_linux_package_name
run: |
PACKAGE_FILE=$(ls artifact/*.flatpak)
PACKAGE_BASENAME=$(basename "$PACKAGE_FILE" | sed 's/\./-/g')
echo "PACKAGE_BASENAME=$PACKAGE_BASENAME" >> $GITHUB_OUTPUT
- name: Upload Flatpak bundle
uses: actions/upload-artifact@v7
with:
name: ${{ steps.get_linux_package_name.outputs.PACKAGE_BASENAME }}
path: artifact/*.flatpak*