deskflow/.github/workflows/job-build-flatpak.yaml
Daun Chung cae96765cb
flatpack workflow to build flatpak installer (#7177)
* flatpack workflow to build flatpak installer

* rename flatpak build name

* changing job-build-flatpak, disabling other job-tests meanwhile

* update apt before attempting to install flatpak

* changing install command

* adding logs for installing flatpak

* running installation as root

* running installation as root - for each command

* attempting to use github action to build flatpak

* fix typo on name

* typo in image

* adding privilege option and fixing manifest path

* changing manifest-path

* uploading bundle to artifact

* changing synergy.desktop for flatpak build

* adding versioning to flatpak bundle and upload to bin storage on release

* version info fix

* running build_version as root

* adding __w to safe directory

* adding git config safe directory command to builder

* testing which part of version info is breaking

* falling back to local build of flatpak

* running only the normal synergy

* investigating build_version.py

* investigating build_version.py 2

* investigating build_version.py 3

* checking if raspberry pi build is working correctly

* get subprocess error

* printing subprocess error

* disabling try catch in version

* running git rev-list --tags command

* running git rev-list --tags command

* disabling other tests

* trying to run extra step in gitaction

* trying to remove extra step in gitaction

* fixing issues with subprocess

* try to run git rev-list

* test

* ignore versioning

* run original flatpak

* testing various build options

* attempting to run flatpak through raspberry

* raspberry flatpak installation 1

* fixing tabs in flatpak build

* trying apt over apt-get

* removing sudo from build process

* removing apt update

* trying to build without versioning

* testing build without publish

* testing

* adding fetch-depth in checkout

* checking out with v3

* getting flatpak to run without github action

* using ubuntu20.04 container

* attempting to add __w into safe directory

* adding dependencies installation

* remove sudo from installing dependencies

* removing all sudo commands from flatpak install

* moving all the apt-get installs in dependencies job

* add yes response to flatpak platform & sdk install

* proper install command for flatpak builder

* flathub input yes to flatpak builder install

* check if flatpak folder exist

* adding flatpak using apt-get

* add privilege option in docker

* removing flatpak finalize build / remove com.symless.Synergy

* listing flatpak dir

* testing to publish flatpak

* checking the directory for flatpak file

* correcting the path for scp action

* attempting to create a specific file in scp

* flatpak workflow cleanup

* cleaning up

* adding changelog info and changing flatpak patch files location

* fedora add safe directory

* creating business/enterprise YAML to replace based on env var

* build test

* disabling tests

* fixing YAML struct

* disabling replace action to see if its causing issue

* changing cp command without backslash

* checking if condition syntax

* uncommenting error at build_version

* fixing file location

* cleaning up actions

* changing workkflow to use .yml file without copying

* finalizing git action

* Remove git safe directory

* Add final line to missing files

* Move safe directory workaround

* Minor cleanup for flatpak files

Co-authored-by: Daun Chung <daunchung@github.com>
Co-authored-by: Kyle Bloom <kyle@symless.com>
2022-05-27 15:42:01 +01:00

98 lines
3.9 KiB
YAML

name: Ubuntu-flatpak
on:
release:
types: [created]
jobs:
build-flatpak-bundle:
name: ubuntu-flatpak
runs-on: ubuntu-latest
container:
image: symless/synergy-core:ubuntu20.04
options: --privileged
strategy:
matrix:
name: [synergy, synergy-enterprise, synergy-business]
include:
- name: synergy
remote_folder: v1-core-standard
- name: synergy-enterprise
remote_folder: v1-core-enterprise
- name: synergy-business
remote_folder: v1-core-business
env:
GIT_COMMIT: ${{ github.sha }}
SYNERGY_ENTERPRISE: ${{ matrix.enterprise }}
SYNERGY_BUSINESS: ${{ matrix.business }}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: "0"
- name: Install Dependencies
run: |
apt-get update
apt-get install -y \
cmake python3 g++ \
libssl-dev libx11-dev xorg-dev qtbase5-dev \
libglib2.0-dev libgdk-pixbuf2.0-dev libnotify-dev \
flatpak flatpak-builder
- name: Work around https://github.com/actions/checkout/issues/766
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Version Info
id: version
run: |
python3 CI/build_version.py
mkdir -p version-info && cd version-info && cmake .. && cd ..
. ./version-info/version
rm -rf version-info
SYNERGY_VERSION="$SYNERGY_VERSION_MAJOR.$SYNERGY_VERSION_MINOR.$SYNERGY_VERSION_PATCH"
SYNERGY_REVISION=$(git rev-parse --short=8 HEAD)
SYNERGY_DEB_VERSION="${SYNERGY_VERSION}.${SYNERGY_VERSION_STAGE}.${SYNERGY_REVISION}"
echo "::set-output name=SYNERGY_VERSION_MAJOR::${SYNERGY_VERSION_MAJOR}"
echo "::set-output name=SYNERGY_VERSION_MINOR::${SYNERGY_VERSION_MINOR}"
echo "::set-output name=SYNERGY_VERSION_PATCH::${SYNERGY_VERSION_PATCH}"
echo "::set-output name=SYNERGY_VERSION_STAGE::${SYNERGY_VERSION_STAGE}"
echo "::set-output name=SYNERGY_VERSION_BUILD::${SYNERGY_VERSION_BUILD}"
echo "::set-output name=SYNERGY_VERSION::${SYNERGY_VERSION}"
echo "::set-output name=SYNERGY_REVISION::${SYNERGY_REVISION}"
echo "::set-output name=SYNERGY_DEB_VERSION::${SYNERGY_DEB_VERSION}"
echo "::set-output name=SYNERGY_REMOTE_FOLDER::${{ matrix.remote_folder }}/${SYNERGY_VERSION}/${SYNERGY_VERSION_STAGE}/b${SYNERGY_VERSION_BUILD}-${SYNERGY_REVISION}"
echo "::set-output name=SYNERGY_PACKAGE_NAME::${{ matrix.name }}"
- name: Install flatpak
run: |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y org.kde.Platform//5.15-21.08
flatpak install -y org.kde.Sdk//5.15-21.08
- name: Build
run: |
cd flatpak
flatpak-builder build ${{ matrix.name }}.yml --disable-cache --force-clean
flatpak build-export export build
flatpak build-bundle export ${{ matrix.name }}.flatpak com.symless.Synergy master --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
- name: Upload Artifact
uses: actions/upload-artifact@v2
if: "github.event_name == 'pull_request'"
with:
name: Bundle
path: flatpak/${{ matrix.name }}.flatpak
retention-days: 1
- name: Send package to Binary Storage
if: "github.event_name == 'pull_request'"
uses: garygrossgarten/github-action-scp@v0.7.3
with:
local: flatpak/${{ matrix.name }}.flatpak
remote: ${{ secrets.BINARIES_SSH_DIR }}/${{ steps.version.outputs.SYNERGY_REMOTE_FOLDER }}/${{ matrix.name }}.flatpak
host: ${{ secrets.BINARIES_SSH_HOST }}
username: ${{ secrets.BINARIES_SSH_USER }}
privateKey: ${{ secrets.BINARIES_SSH_KEY }}