Skip to content

Commit

Permalink
[#434] [CI] Flatpack crash. Replace broken pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
lyskouski committed Dec 19, 2023
1 parent de54e35 commit 5955814
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 38 deletions.
45 changes: 7 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,44 +287,13 @@ jobs:

# Linux Flatpak
build-flatpak:
name: Create Linux Flatpak build
needs:
- release
- build
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-45
options: --privileged
steps:
- uses: actions/checkout@v3

- name: Patch Manifest
run: |
ASSET_URL="https://github.com/lyskouski/app-finance/releases/download/v${{ needs.release.outputs.version }}/fingrom_Linux.tar.gz"
curl -vLJO -H 'Accept: application/octet-stream' $ASSET_URL
sh patch.sh -i ${{ github.sha }} -v "${{ needs.release.outputs.version }}" -s $(sha256sum fingrom_Linux.tar.gz | gawk '{ print $1 }')
working-directory: linux-flatpak

- name: Build Linux Flatpak
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v5
with:
bundle: fingrom_LinuxFlatpak.flatpak
manifest-path: linux-flatpak/com.tercad.fingrom.yml

- name: Store Configs for github.com/flathub
if: always()
uses: actions/upload-artifact@v3
with:
name: flatpak-configs
path: linux-flatpak

- name: Upload ${{ matrix.target }} Artifact
id: upload_release_asset
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./fingrom_LinuxFlatpak.flatpak
asset_name: fingrom_LinuxFlatpak.flatpak
asset_content_type: application/zip
uses: ./.github/workflows/build_package_flatpack.yml
secrets: inherit
with:
version: ${{ needs.release.outputs.version }}
sha: ${{ github.sha }}
upload_url: ${{ needs.release.outputs.upload_url }}
is_release: true
74 changes: 74 additions & 0 deletions .github/workflows/build_package_flatpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Create Release Page

on:
workflow_call:
inputs:
upload_url:
description: "Release page URL"
type: string
version:
description: "Latest tag name"
type: string
sha:
description: "Current git commit"
type: string
is_release:
description: "Attach artifacts to Release"
default: false
type: boolean
is_build:
description: "Attach artifacts to Build"
default: false
type: boolean

jobs:
build:
name: Create Linux Flatpak build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Patch Manifest
run: |
ASSET_URL="https://github.com/lyskouski/app-finance/releases/download/v${{ inputs.version }}/fingrom_Linux.tar.gz"
curl -vLJO -H 'Accept: application/octet-stream' $ASSET_URL
sh patch.sh -i ${{ inputs.sha }} -v "${{ inputs.version }}" -s $(sha256sum fingrom_Linux.tar.gz | gawk '{ print $1 }')
working-directory: linux-flatpak

- name: Build Linux Flatpak
run: |
sudo apt-get install -y flatpak flatpak-builder
flatpak install flathub org.gnome.Platform//45 org.gnome.Sdk//45
sudo flatpak-builder --install build-dir com.tercad.fingrom.yml
flatpak build-bundle /var/lib/flatpak/repo fingrom_LinuxFlatpak.flatpak com.tercad.fingrom
working-directory: linux-flatpak

with:
bundle: fingrom_LinuxFlatpak.flatpak
manifest-path: linux-flatpak/com.tercad.fingrom.yml

- name: Store Configs for github.com/flathub
uses: actions/upload-artifact@v3
with:
name: flatpak-configs
path: |
linux-flatpak/com.tercad.fingrom.metainfo.xml
linux-flatpak/com.tercad.fingrom.yml
- name: Add Flatpak Artifact to Build
if: inputs.is_build
uses: actions/upload-artifact@v3
with:
name: fingrom_LinuxFlatpak
path: linux-flatpak/fingrom_LinuxFlatpak.flatpak

- name: Add Flatpak Artifact to Release
if: inputs.is_release
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: linux-flatpak/fingrom_LinuxFlatpak.flatpak
asset_name: fingrom_LinuxFlatpak.flatpak
asset_content_type: application/zip

0 comments on commit 5955814

Please sign in to comment.