merge and update revision IDs
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Thu, 28 Jul 2022 17:05:53 +0200
changeset 73 5b6508694623
parent 68 8eb533b797be (diff)
parent 72 32f7056a3ae6 (current diff)
child 74 46a4c1f5113b
merge and update revision IDs
.github/workflows/build_bundles.yml
.github/workflows/prep_sources.yml
--- a/.github/workflows/build_bundles.yml	Thu May 26 23:43:30 2022 +0200
+++ b/.github/workflows/build_bundles.yml	Thu Jul 28 17:05:53 2022 +0200
@@ -1,61 +1,18 @@
-name: Build distributable bundles
-
-# This overrides HG revision IDs in Makefile
-env:
-    beremiz_revisionid: 776774ca37b9569cd1d25f0401689646a60d5ebb
-    matiec_revisionid: 2a25f4dbf4e2b1e017a3a583db7dede4771fe523
-    canfestival_revisionid: 12a05e422666c738d1312259703f80150c747cb5
+name: Build windows installer in Docker.
 
 on:
-  push:
-    branches: [ default ]
+  workflow_dispatch:
+  # push:
+  #   branches: [ default ]
 
 jobs:
+  sources:
+    uses: ./.github/workflow/prep_sources
 
   build:
-
     runs-on: ubuntu-latest
 
     steps:
-    - uses: actions/checkout@v3
-      with:
-          path: beremiz_public_dist
-
-    # repositories are directly checked out wher Makerfile expect them
-    - uses: actions/checkout@v3
-      with:
-          repository: beremiz/beremiz
-          ref: ${{ env.beremiz_revisionid }}
-          path: build/sources/beremiz
-
-    - uses: actions/checkout@v3
-      with:
-          repository: beremiz/matiec
-          ref: ${{ env.matiec_revisionid }}
-          path: build/sources/matiec
-
-    - uses: actions/checkout@v3
-      with:
-          repository: beremiz/canfestival
-          ref: ${{ env.canfestival_revisionid }}
-          path: build/sources/canfestival
-
-    - name: Touch expected Makfile targets to shortcut HG checkout
-      run: |
-        touch build/sources/beremiz_${{ env.beremiz_revisionid }}
-        touch build/sources/matiec_${{ env.matiec_revisionid }}
-        touch build/sources/canfestival_${{ env.canfestival_revisionid }}
-        touch build/sources/beremiz_src
-        touch build/sources/matiec_src
-        touch build/sources/canfestival_src
-        touch build/own_sources
-        cat >> build/revisions.txt <<EOF
-        beremiz_public_dist ${{ github.sha }}
-        beremiz ${{ env.beremiz_revisionid }}
-        matiec ${{ env.matiec_revisionid }}
-        canfestival ${{ env.canfestival_revisionid }}
-        EOF
-
     - name: Cache docker image
       id: cache-docker
       uses: actions/cache@v3
@@ -85,10 +42,11 @@
     - name: Run build in docker
       run: |
         cd beremiz_public_dist
+        # override HG revision IDs in Makefile
         ./build_in_docker.sh \
-            beremiz_revisionid=${{ env.beremiz_revisionid }} \
-            matiec_revisionid=${{ env.matiec_revisionid }} \
-            canfestival_revisionid=${{ env.canfestival_revisionid }}
+            beremiz_revisionid=${{ needs.sources.outputs.beremiz_revisionid }} \
+            matiec_revisionid=${{ needs.sources.outputs.matiec_revisionid }} \
+            canfestival_revisionid=${{ needs.sources.outputs.canfestival_revisionid }}
 
     - name: Upload built artifact
       uses: actions/upload-artifact@v3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.github/workflows/prep_sources.yml	Thu Jul 28 17:05:53 2022 +0200
@@ -0,0 +1,61 @@
+name: Prepare sources
+
+env:
+    beremiz_revisionid: c3847f87bde2d520b856e353498cb2bad9d83911
+    matiec_revisionid: ba00e2b18e7335c03c011e1c6b2a5d99fc3571c3
+    canfestival_revisionid: 12a05e422666c738d1312259703f80150c747cb5
+
+on:
+  workflow_call:
+    outputs:
+      beremiz_revisionid:
+        value: ${{ env.beremiz_revisionid }}
+      matiec_revisionid:
+        value: ${{ env.matiec_revisionid }}
+      canfestival_revisionid:
+        value: ${{ env.canfestival_revisionid }}
+
+jobs:
+  get_sources:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v3
+      with:
+          path: beremiz_public_dist
+
+    # repositories are directly checked out where Makerfile expects them to be
+    - uses: actions/checkout@v3
+      with:
+          repository: beremiz/beremiz
+          ref: ${{ env.beremiz_revisionid }}
+          path: build/sources/beremiz
+
+    - uses: actions/checkout@v3
+      with:
+          repository: beremiz/matiec
+          ref: ${{ env.matiec_revisionid }}
+          path: build/sources/matiec
+
+    - uses: actions/checkout@v3
+      with:
+          repository: beremiz/canfestival
+          ref: ${{ env.canfestival_revisionid }}
+          path: build/sources/canfestival
+
+    - name: Touch expected Makfile targets to shortcut HG checkout
+      run: |
+        touch build/sources/beremiz_${{ env.beremiz_revisionid }}
+        touch build/sources/matiec_${{ env.matiec_revisionid }}
+        touch build/sources/canfestival_${{ env.canfestival_revisionid }}
+        touch build/sources/beremiz_src
+        touch build/sources/matiec_src
+        touch build/sources/canfestival_src
+        touch build/own_sources
+        cat >> build/revisions.txt <<EOF
+        beremiz_public_dist ${{ github.sha }}
+        beremiz ${{ env.beremiz_revisionid }}
+        matiec ${{ env.matiec_revisionid }}
+        canfestival ${{ env.canfestival_revisionid }}
+        EOF
+