.github/workflows/build_snap.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Sun, 14 Aug 2022 16:54:43 +0200
changeset 97 4dd65c75e651
parent 93 b1f29a911785
child 98 54c0e2662dd3
permissions -rw-r--r--
GH CD: Seriously ? https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
name: Build Snap

on:
  workflow_dispatch:
  # push:
  #   branches: [ default ]

jobs:
  sources:
    uses: ./.github/workflows/prep_sources.yml

  build:
    needs: sources
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        # checkout directly in build/sources so that
        # sources dirs are aside snap dir
        path: beremiz_public_dist

    - name: Download source artifact
      uses: actions/download-artifact@v3
      with:
        name: source_package

    - name: untar files
      run: tar -xvf build.tar

    - name: Move snap dir in build/sources
      run: |
        ls -R
        mv beremiz_public_dist/snap build/sources
        ls build/sources

    - name: Invoke snapcraft build
      uses: snapcore/action-build@v1
      id: snapcraft
      with:
        path: build/sources

    - name: Upload built artifact
      uses: actions/upload-artifact@v3
      with:
        name: snap
        path: ${{ steps.snapcraft.outputs.snap }}