.github/workflows/prep_sources.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Sat, 13 Aug 2022 23:19:14 +0200
changeset 95 21dcb1a70f5d
parent 91 8d8e7a792903
child 96 52b64ebc1970
permissions -rw-r--r--
GH CD: place revisions.txt so that snapcraft can find it.
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
name: Prepare sources
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
on:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
  workflow_call:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
    outputs:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
      beremiz_revisionid:
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
     7
        value: ${{ jobs.get_sources.env.beremiz_revisionid }}
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
      matiec_revisionid:
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
     9
        value: ${{ jobs.get_sources.env.matiec_revisionid }}
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
      canfestival_revisionid:
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    11
        value: ${{ jobs.get_sources.env.canfestival_revisionid }}
84
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    12
      Modbus_revisionid:
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    13
        value: ${{ jobs.get_sources.env.Modbus_revisionid }}
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    14
      open62541_revisionid:
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    15
        value: ${{ jobs.get_sources.env.opem62541_revisionid }}
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    17
jobs:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    18
  get_sources:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    19
    runs-on: ubuntu-latest
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    20
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    21
    env:
91
8d8e7a792903 Beremiz revision bump
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 85
diff changeset
    22
        beremiz_revisionid: 45a361db05a3e243ad15467fa066ea96aee48861
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    23
        matiec_revisionid: ba00e2b18e7335c03c011e1c6b2a5d99fc3571c3
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    24
        canfestival_revisionid: 12a05e422666c738d1312259703f80150c747cb5
84
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    25
        Modbus_revisionid: 75ba7cb15908411e71bf0e7b66651d182f347747
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    26
        open62541_revisionid: ff73268829359639531ff02905c889f73a77b408
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    27
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    28
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    29
    steps:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    30
    # repositories are directly checked out where Makerfile expects them to be
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    31
    - uses: actions/checkout@v3
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    32
      with:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    33
          repository: beremiz/beremiz
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
          ref: ${{ env.beremiz_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
          path: build/sources/beremiz
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    36
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
    - uses: actions/checkout@v3
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    38
      with:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    39
          repository: beremiz/matiec
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
          ref: ${{ env.matiec_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    41
          path: build/sources/matiec
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    42
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
    - uses: actions/checkout@v3
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    44
      with:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    45
          repository: beremiz/canfestival
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    46
          ref: ${{ env.canfestival_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    47
          path: build/sources/canfestival
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    48
84
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    49
    - uses: actions/checkout@v3
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    50
      with:
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    51
          repository: beremiz/Modbus
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    52
          ref: ${{ env.Modbus_revisionid }}
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    53
          path: build/sources/Modbus
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    54
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    55
    - uses: actions/checkout@v3
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    56
      with:
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    57
          repository: open62541/open62541
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    58
          ref: ${{ env.open62541_revisionid }}
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    59
          path: build/sources/open62541
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    60
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    61
    - name: Touch expected Makfile targets to shortcut HG checkout
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    62
      run: |
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    63
        touch build/sources/beremiz_${{ env.beremiz_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    64
        touch build/sources/matiec_${{ env.matiec_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    65
        touch build/sources/canfestival_${{ env.canfestival_revisionid }}
84
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    66
        touch build/sources/Modbus_${{ env.Modbus_revisionid }}
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    67
        touch build/sources/open62541_${{ env.open62541_revisionid }}
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    68
        touch build/sources/beremiz_src
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    69
        touch build/sources/matiec_src
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    70
        touch build/sources/canfestival_src
84
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    71
        touch build/sources/Modbus_src
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    72
        touch build/sources/open62541_src
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    73
        touch build/own_sources
95
21dcb1a70f5d GH CD: place revisions.txt so that snapcraft can find it.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 91
diff changeset
    74
        cat >> build/sources/revisions.txt <<EOF
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    75
        beremiz_public_dist ${{ github.sha }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    76
        beremiz ${{ env.beremiz_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    77
        matiec ${{ env.matiec_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    78
        canfestival ${{ env.canfestival_revisionid }}
84
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    79
        Modbus ${{ env.Modbus_revisionid }}
8e01f3bb59df GH CD: Add Modbus and open62541 sources.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 77
diff changeset
    80
        open62541 ${{ env.open62541_revisionid }}
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    81
        EOF
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    82
77
2f3d1cd0bd64 GH CI : use artifacts to get data flowing from one workflow to the other
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 76
diff changeset
    83
    - name: Upload source artifact
2f3d1cd0bd64 GH CI : use artifacts to get data flowing from one workflow to the other
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 76
diff changeset
    84
      uses: actions/upload-artifact@v3
2f3d1cd0bd64 GH CI : use artifacts to get data flowing from one workflow to the other
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 76
diff changeset
    85
      with:
2f3d1cd0bd64 GH CI : use artifacts to get data flowing from one workflow to the other
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 76
diff changeset
    86
        name: source_package
2f3d1cd0bd64 GH CI : use artifacts to get data flowing from one workflow to the other
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 76
diff changeset
    87
        path: build