From 1d9dd134b95294aac1cbb4b959273e63d6f548ec Mon Sep 17 00:00:00 2001 From: Viachaslau Lyskouski Date: Tue, 19 Dec 2023 18:45:26 +0100 Subject: [PATCH] [#434] [CI] Flatpack crash. Replace broken pipe --- .github/workflows/build.yml | 42 ++--------- .github/workflows/build_package_flatpack.yml | 74 ++++++++++++++++++++ 2 files changed, 80 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/build_package_flatpack.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f3502ca98..3844436880 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -287,44 +287,14 @@ jobs: # Linux Flatpak build-flatpak: - name: Create Linux Flatpak build - needs: + 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 }} + - 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 }} - asset_path: ./fingrom_LinuxFlatpak.flatpak - asset_name: fingrom_LinuxFlatpak.flatpak - asset_content_type: application/zip + is_release: true \ No newline at end of file diff --git a/.github/workflows/build_package_flatpack.yml b/.github/workflows/build_package_flatpack.yml new file mode 100644 index 0000000000..9bff801f1e --- /dev/null +++ b/.github/workflows/build_package_flatpack.yml @@ -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