.github/workflows/build_snap.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Sat, 13 Aug 2022 17:26:17 +0200
changeset 90 ab4e99dc80cb
parent 88 58cff3acaf3d
child 92 eb3e1cdc7389
permissions -rw-r--r--
GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
80
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
name: Build Snap
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
on:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
  workflow_dispatch:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
  # push:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
  #   branches: [ default ]
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
jobs:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
  sources:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
    uses: ./.github/workflows/prep_sources.yml
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    11
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
  build:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
    needs: sources
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
    runs-on: ubuntu-latest
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
    steps:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    17
    - uses: actions/checkout@v3
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    18
      with:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    19
        # checkout directly in build/sources so that
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    20
        # sources dirs are aside snap dir
90
ab4e99dc80cb GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 88
diff changeset
    21
        path: beremiz_public_dist
80
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    22
88
58cff3acaf3d GH CD: attempt to preserve content of build/source by swapping checkout and artifact download steps.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 80
diff changeset
    23
    - name: Download source artifact
58cff3acaf3d GH CD: attempt to preserve content of build/source by swapping checkout and artifact download steps.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 80
diff changeset
    24
      uses: actions/download-artifact@v3
58cff3acaf3d GH CD: attempt to preserve content of build/source by swapping checkout and artifact download steps.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 80
diff changeset
    25
      with:
58cff3acaf3d GH CD: attempt to preserve content of build/source by swapping checkout and artifact download steps.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 80
diff changeset
    26
        name: source_package
58cff3acaf3d GH CD: attempt to preserve content of build/source by swapping checkout and artifact download steps.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 80
diff changeset
    27
90
ab4e99dc80cb GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 88
diff changeset
    28
    - name: Move snap dir in build/sources
ab4e99dc80cb GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 88
diff changeset
    29
      run: |
ab4e99dc80cb GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 88
diff changeset
    30
        mv beremiz_public_dist/snap build/sources
ab4e99dc80cb GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 88
diff changeset
    31
        ls build/sources
ab4e99dc80cb GH CD: Merge sources and snap dir instead of just giving checkout and artfifact download the same path
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 88
diff changeset
    32
80
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    33
    - name: Invoke snapcraft build
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
      uses: snapcore/action-build@v1
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
      id: snapcraft
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    36
      with:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
        path: build/sources
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    38
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    39
    - name: Upload built artifact
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
      uses: actions/upload-artifact@v3
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    41
      with:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    42
        name: snap
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
        path: ${{ steps.snapcraft.outputs.snap }}
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    44
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    45