deskflow/.github/workflows/job-build-flatpak.yaml
Nick Bolton 55f68ed3e9
Switch to GitHub hosted Mac M1 runner (#7321)
* Switch to macos-latest-xlarge

* Improve job names

* Update create-release.yml

* Fixed workflow job names

* Further improve workflow naming

* Remove double checkout

* Rename Mac 11 workflow

* Remove redundant word

* Update ChangeLog

* Add matrix names for macOS

* Create test

* Delete test
2024-01-09 16:21:13 +00:00

105 lines
4.2 KiB
YAML

name: "Build Linux Flatpak"
on:
release:
types: [created]
jobs:
build-linux-flatpak:
name: ubuntu-flatpak
runs-on: ubuntu-latest
container:
image: symless/synergy-core:ubuntu20.04
options: --privileged
strategy:
matrix:
runtime:
- name: synergy
remote_folder: v1-core-standard
enterprise: ""
business: ""
- name: synergy-enterprise
remote_folder: v1-core-enterprise
enterprise: "1"
business: ""
- name: synergy-business
remote_folder: v1-core-business
enterprise: ""
business: "1"
env:
GIT_COMMIT: ${{ github.sha }}
SYNERGY_ENTERPRISE: ${{ matrix.runtime.enterprise }}
SYNERGY_BUSINESS: ${{ matrix.runtime.business }}
steps:
- name: Checkout git repo
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 scripts/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_FLATPAK_NAME="${{ matrix.runtime.name }}_${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_FLATPAK_NAME::${SYNERGY_FLATPAK_NAME}"
echo "::set-output name=SYNERGY_REMOTE_FOLDER::${{ matrix.runtime.remote_folder }}/${SYNERGY_VERSION}/${SYNERGY_VERSION_STAGE}/b${SYNERGY_VERSION_BUILD}-${SYNERGY_REVISION}"
- 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.runtime.name }}.yml --disable-cache --force-clean
flatpak build-export export build
flatpak build-bundle export ${{ steps.version.outputs.SYNERGY_FLATPAK_NAME }}.flatpak com.symless.Synergy master --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
- name: Upload Artifact
if: "github.event_name == 'pull_request'"
uses: actions/upload-artifact@v2
with:
name: ${{ steps.version.outputs.SYNERGY_FLATPAK_NAME }}
path: flatpak/${{ steps.version.outputs.SYNERGY_FLATPAK_NAME }}.flatpak
retention-days: 1
- name: Send package to Binary Storage
if: "github.event_name == 'release'"
uses: garygrossgarten/github-action-scp@v0.7.3
with:
local: flatpak/${{ steps.version.outputs.SYNERGY_FLATPAK_NAME }}.flatpak
remote: ${{ secrets.BINARIES_SSH_DIR }}/${{ steps.version.outputs.SYNERGY_REMOTE_FOLDER }}/${{ steps.version.outputs.SYNERGY_FLATPAK_NAME }}.flatpak
host: ${{ secrets.BINARIES_SSH_HOST }}
username: ${{ secrets.BINARIES_SSH_USER }}
privateKey: ${{ secrets.BINARIES_SSH_KEY }}