.github/workflows/prep_sources.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 28 Jul 2022 17:44:10 +0200
changeset 77 2f3d1cd0bd64
parent 76 1ed6c9812863
child 84 8e01f3bb59df
permissions -rw-r--r--
GH CI : use artifacts to get data flowing from one workflow to the other
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 }}
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
jobs:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
  get_sources:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
    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
    16
76
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    17
    env:
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    18
        beremiz_revisionid: c3847f87bde2d520b856e353498cb2bad9d83911
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    19
        matiec_revisionid: ba00e2b18e7335c03c011e1c6b2a5d99fc3571c3
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    20
        canfestival_revisionid: 12a05e422666c738d1312259703f80150c747cb5
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    21
1ed6c9812863 GH CI : adapt to workflow syntax restrictions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 73
diff changeset
    22
68
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
    steps:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
    # 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
    25
    - 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
    26
      with:
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    27
          repository: beremiz/beremiz
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    28
          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
    29
          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
    30
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/matiec
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
          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
    35
          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
    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/canfestival
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
          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
    41
          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
    42
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
    - 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
    44
      run: |
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    45
        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
    46
        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
    47
        touch build/sources/canfestival_${{ env.canfestival_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    48
        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
    49
        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
    50
        touch build/sources/canfestival_src
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    51
        touch build/own_sources
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    52
        cat >> build/revisions.txt <<EOF
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    53
        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
    54
        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
    55
        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
    56
        canfestival ${{ env.canfestival_revisionid }}
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    57
        EOF
8eb533b797be GH action : split workflows for later re-use of source provisioning.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    58
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
    59
    - 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
    60
      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
    61
      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
    62
        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
    63
        path: build