name: 'Build Linux'

on:
  workflow_call:
      
jobs:
  build-snapcraft:
    name: Snapcraft
    runs-on: ubuntu-latest
    steps:
      - name: Setup Environment
        uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master
        with:
          platform: linux
      
      - name: Build LunaSea
        uses: snapcore/action-build@v1
        id: build
      
      - name: Prepare Artifact
        run: mv ${{ steps.build.outputs.snap }} ${{ github.workspace }}/output/lunasea-linux-amd64.snap

      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: linux-snapcraft
          path: ${{ github.workspace }}/output
