mirror of
				https://github.com/hedge-dev/UnleashedRecomp.git
				synced 2025-10-30 07:11:05 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			73 lines
		
	
	
		
			No EOL
		
	
	
		
			2.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			73 lines
		
	
	
		
			No EOL
		
	
	
		
			2.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Build Project (Flatpak)
 | 
						|
 | 
						|
on:
 | 
						|
  workflow_dispatch:
 | 
						|
 | 
						|
env:
 | 
						|
  FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
 | 
						|
  FREEDESKTOP_VERSION: 23.08
 | 
						|
  LLVM_VERSION: 18
 | 
						|
 | 
						|
jobs:
 | 
						|
  build-flatpak:
 | 
						|
    name: Build Flatpak
 | 
						|
    runs-on: ubuntu-24.04
 | 
						|
 | 
						|
    steps:
 | 
						|
      - name: Checkout repository
 | 
						|
        uses: actions/checkout@v4
 | 
						|
        with:
 | 
						|
          submodules: recursive
 | 
						|
          token: ${{ secrets.ORG_TOKEN }}
 | 
						|
 | 
						|
      - name: Checkout private repository
 | 
						|
        uses: actions/checkout@v4
 | 
						|
        with:
 | 
						|
          repository: ${{ secrets.ASSET_REPO }}
 | 
						|
          token: ${{ secrets.ASSET_REPO_TOKEN }}
 | 
						|
          path: flatpak/private
 | 
						|
 | 
						|
      - name: Install dependencies
 | 
						|
        run: |-
 | 
						|
          sudo apt update
 | 
						|
          sudo apt install -y flatpak-builder ccache
 | 
						|
 | 
						|
      - name: Cache ccache directory
 | 
						|
        uses: actions/cache@v4
 | 
						|
        with:
 | 
						|
          path: /tmp/ccache
 | 
						|
          key: ccache-${{ runner.os }}
 | 
						|
 | 
						|
      - name: Prepare Flatpak
 | 
						|
        run: |
 | 
						|
          flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
 | 
						|
          flatpak --user install -y flathub org.freedesktop.Sdk//${{ env.FREEDESKTOP_VERSION }}
 | 
						|
          flatpak --user install -y flathub org.freedesktop.Sdk.Extension.llvm${{ env.LLVM_VERSION }}//${{ env.FREEDESKTOP_VERSION }}
 | 
						|
 | 
						|
      - name: Build Flatpak
 | 
						|
        run: |
 | 
						|
          echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
 | 
						|
          export CCACHE_DIR=/tmp/ccache
 | 
						|
          flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json
 | 
						|
          flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
 | 
						|
 | 
						|
# Uploads the built flatpak bundle to GitHub
 | 
						|
#      - name: Upload artifact
 | 
						|
#        uses: actions/upload-artifact@v4
 | 
						|
#        with:
 | 
						|
#          name: UnleashedRecomp-flatpak
 | 
						|
#          path: ./${{ env.FLATPAK_ID }}.flatpak
 | 
						|
      
 | 
						|
      - name: Upload artifact to Discord
 | 
						|
        env: 
 | 
						|
          DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
 | 
						|
        if: ${{ env.DISCORD_WEBHOOK != '' }}
 | 
						|
        uses: tsickert/discord-webhook@v6.0.0
 | 
						|
        with:
 | 
						|
          webhook-url: ${{ env.DISCORD_WEBHOOK }}
 | 
						|
          content: |
 | 
						|
            OS: Linux
 | 
						|
            Summary: ${{ env.commit_message }}
 | 
						|
            Commit: ${{ github.sha }}
 | 
						|
            Branch: ${{ github.ref_name }}
 | 
						|
          filename: ./${{ env.FLATPAK_ID }}.flatpak |