@@ -73,21 +73,24 @@ jobs:
7373 strategy :
7474 fail-fast : true
7575 matrix :
76- julia-version : ['1.10 ', '1.11 ']
76+ julia-version : ['1', 'lts ']
7777
7878 steps :
7979 - name : Checkout code
8080 uses : actions/checkout@v5
8181
82- - name : Install matplotlib
83- run : if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get update && sudo apt-get install -y python3-matplotlib; fi
84- shell : bash
85-
8682 - name : Setup Julia ${{ matrix.julia-version }}
8783 uses : julia-actions/setup-julia@v2
8884 with :
8985 version : ${{ matrix.julia-version }}
9086
87+ - name : Detect Julia version
88+ id : detect_version
89+ run : |
90+ JULIA_VERSION=$(julia --version | cut -d' ' -f3 | cut -d'.' -f1,2)
91+ echo "version=$JULIA_VERSION" >> $GITHUB_OUTPUT
92+ echo "Detected Julia version: $JULIA_VERSION"
93+
9194 - name : Install ArtifactUtils package
9295 run : julia -e 'using Pkg; Pkg.add("ArtifactUtils");'
9396
@@ -103,15 +106,15 @@ jobs:
103106 - name : Upload tar.gz artifacts
104107 uses : actions/upload-artifact@v4
105108 with :
106- name : model-tarballs-${{ matrix.julia- version }}
107- path : data/models_v${{ matrix.julia- version }}.tar.gz
109+ name : model-tarballs-${{ steps.detect_version.outputs. version }}
110+ path : data/models_v${{ steps.detect_version.outputs. version }}.tar.gz
108111 retention-days : 7
109112
110113 # Upload the entire workspace to capture the generated TOML files.
111- - name : Upload workspace for Julia ${{ matrix.julia- version }}
114+ - name : Upload workspace for Julia ${{ steps.detect_version.outputs. version }}
112115 uses : actions/upload-artifact@v4
113116 with :
114- name : workspace-${{ matrix.julia- version }}
117+ name : workspace-${{ steps.detect_version.outputs. version }}
115118 path : .
116119 retention-days : 1
117120
@@ -150,33 +153,49 @@ jobs:
150153 - name : Checkout a clean version of the code
151154 uses : actions/checkout@v5
152155
153- # Download only the specific workspace artifacts needed.
154- - name : Download workspace-1.10 artifact
155- uses : actions/download-artifact@v4
156- with :
157- name : workspace-1.10
158- path : ./artifacts/workspace-1.10
159-
160- - name : Download workspace-1.11 artifact
156+ # Download all workspace artifacts (regardless of version)
157+ - name : Download all workspace artifacts
161158 uses : actions/download-artifact@v4
162159 with :
163- name : workspace-1.11
164- path : ./artifacts/workspace-1.11
160+ pattern : workspace-*
161+ path : ./artifacts
165162
166163 # Merge the version-specific artifact files and restore manifests.
167164 - name : Merge and Restore TOML files from artifacts
168165 run : |
169166 echo "Merging version-specific Artifacts.toml files..."
170- # Use cat to concatenate the two files into one.
171- # A blank line is added between them for readability.
172- cat ./artifacts/workspace-1.10/Artifacts-v1.10.toml.default > Artifacts.toml.default
173- echo "" >> Artifacts.toml.default
174- cat ./artifacts/workspace-1.11/Artifacts-v1.11.toml.default >> Artifacts.toml.default
167+
168+ # Find all workspace directories
169+ workspaces=$(find ./artifacts -maxdepth 1 -type d -name "workspace-*" | sort)
170+
171+ # Initialize the merged Artifacts.toml.default
172+ > Artifacts.toml.default
173+
174+ # Process each workspace
175+ first=true
176+ for workspace in $workspaces; do
177+ version=$(basename "$workspace" | sed 's/workspace-//')
178+ echo "Processing workspace for Julia $version..."
179+
180+ # Merge Artifacts.toml files
181+ artifacts_file="$workspace/Artifacts-v${version}.toml.default"
182+ if [ -f "$artifacts_file" ]; then
183+ if [ "$first" = false ]; then
184+ echo "" >> Artifacts.toml.default
185+ fi
186+ cat "$artifacts_file" >> Artifacts.toml.default
187+ first=false
188+ fi
189+
190+ # Copy manifest files
191+ manifest_file="$workspace/Manifest-v${version}.toml.default"
192+ if [ -f "$manifest_file" ]; then
193+ cp "$manifest_file" "./Manifest-v${version}.toml.default"
194+ echo "Copied Manifest-v${version}.toml.default"
195+ fi
196+ done
197+
175198 echo "Final Artifacts.toml.default created."
176-
177- echo "Copying manifest files..."
178- cp ./artifacts/workspace-1.10/Manifest-v1.10.toml.default ./Manifest-v1.10.toml.default
179- cp ./artifacts/workspace-1.11/Manifest-v1.11.toml.default ./Manifest-v1.11.toml.default
180199 echo "Files restored."
181200
182201 # Generate a token from the GitHub App to authorize the PR creation
@@ -202,5 +221,4 @@ jobs:
202221 # Add the paths for all the files you want to include in the PR.
203222 add-paths : |
204223 Artifacts.toml.default
205- Manifest-v1.10.toml.default
206- Manifest-v1.11.toml.default
224+ Manifest-v*.toml.default
0 commit comments