.github/workflows/build_snap.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Mon, 13 Feb 2023 22:03:09 +0100
changeset 112 b78f14613a6c
parent 99 0623d6d4616b
permissions -rw-r--r--
Fix computation of BVERSION leading to error message if beremiz source tree is missing when make is invoked
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
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
    18
    - 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
    19
      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
    20
      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
    21
        name: source_package
97
4dd65c75e651 GH CD: Seriously ? https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 93
diff changeset
    22
4dd65c75e651 GH CD: Seriously ? https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 93
diff changeset
    23
    - name: untar files
99
0623d6d4616b GH CD: chechout all projects, even self from prep_sources.yml so that revisions.txt is not too old for Makefile.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 98
diff changeset
    24
      run: tar -xvf sources.tar
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
    25
98
54c0e2662dd3 revisions.txt is expected in $CWD When building Windows installer, in $CWD/sources for Snap. Deal with it for now.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 97
diff changeset
    26
    - name: Move snap dir and revisions.txt in build/sources
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
    27
      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
    28
        mv beremiz_public_dist/snap build/sources
98
54c0e2662dd3 revisions.txt is expected in $CWD When building Windows installer, in $CWD/sources for Snap. Deal with it for now.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 97
diff changeset
    29
        mv build/revisions.txt build/sources/revisions.txt
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
    30
80
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    31
    - 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
    32
      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
    33
      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
    34
      with:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
        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
    36
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
    - 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
    38
      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
    39
      with:
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
        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
    41
        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
    42
1088ce57d3c9 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43