FRESHMusicPlayer/.github/workflows/linux-flatpak.yml

55 lines
1.9 KiB
YAML
Raw Normal View History

2021-05-02 13:16:07 -04:00
on:
push:
2021-05-02 13:19:11 -04:00
branches:
- master
2021-08-19 03:10:37 -04:00
workflow_dispatch:
inputs:
blueprint:
2021-08-19 03:32:24 -04:00
description: 'Is Blueprint build? (true/false)'
2021-08-19 03:10:37 -04:00
required: true
default: false
release:
types: [published]
2021-05-02 13:19:11 -04:00
2021-05-02 13:16:07 -04:00
name: Linux CI (Flatpak)
jobs:
flatpak-builder:
name: "Flatpak Builder"
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:kde-5.15
options: --privileged
steps:
2021-08-19 03:10:37 -04:00
- shell: bash
2021-08-19 03:17:20 -04:00
id: checkbp
2021-08-19 03:10:37 -04:00
run: |
2021-08-19 03:28:13 -04:00
echo "::set-output name=is-blueprint::${{ (github.event_name == 'push') || (github.event_name == 'workflow_dispatch' && github.event.inputs.blueprint) || (github.event_name == 'release' && false) }}"
2021-08-19 03:17:20 -04:00
- shell: bash
id: setvars
env:
2021-08-19 03:32:24 -04:00
BLUEPRINT: ${{ steps.checkbp.outputs.is-blueprint }}
2021-08-19 03:17:20 -04:00
run: |
2021-08-19 03:32:24 -04:00
if [ $BLUEPRINT == 'true' ]; then
2021-08-19 03:28:13 -04:00
echo "::set-output name=manifest-path::Distribution/io.github.royce551.FRESHMusicPlayer.Blueprint.yml"
echo "::set-output name=repo-name::partner-blueprint"
2021-08-19 03:17:20 -04:00
else
2021-08-19 03:28:13 -04:00
echo "::set-output name=manifest-path::Distribution/io.github.royce551.FRESHMusicPlayer.yml"
echo "::set-output name=repo-name::partner"
2021-08-19 03:17:20 -04:00
fi
2021-05-02 13:16:07 -04:00
- uses: actions/checkout@v2
- uses: bilelmoussaoui/flatpak-github-actions@v2
with:
bundle: "fmp.flatpak"
2021-08-19 03:32:24 -04:00
manifest-path: ${{ steps.setvars.outputs.manifest-path }}
2021-05-02 13:16:07 -04:00
- shell: bash
env:
REPO_TOKEN: ${{ secrets.FLATPAK_REPO_TOKEN }}
REPO_LOCATION: https://flatpak.vicr123.com
2021-08-19 03:32:24 -04:00
REPO_NAME: ${{ steps.setvars.outputs.repo-name }}
2021-05-02 13:16:07 -04:00
run: |
sudo dnf install -y python3-aiohttp python3-tenacity python3-gobject
curl https://github.com/flatpak/flat-manager/releases/download/0.3.7/flat-manager-client -L > flat-manager-client
chmod +x flat-manager-client
./flat-manager-client push --commit --publish $(./flat-manager-client create $REPO_LOCATION $REPO_NAME) repo