2222
2323jobs :
2424 build :
25+ outputs :
26+ output_linux-x86_64 : ${{ fromJson(steps.set-outputs.outputs.output_linux-x86_64) }}
27+ output_linux-x86_64-static : ${{ fromJson(steps.set-outputs.outputs.output_linux-x86_64-static) }}
28+ output_macos-x86_64 : ${{ fromJson(steps.set-outputs.outputs.output_macos-x86_64) }}
29+ output_macos-aarch64 : ${{ fromJson(steps.set-outputs.outputs.output_macos-aarch64) }}
30+
2531 strategy :
2632 fail-fast : false
2733
9298 steps :
9399 - uses : actions/checkout@v5
94100
101+ - uses : ./.github/actions/compute-artifact-names
102+ id : compute-artifact-names
103+ with :
104+ build-name : ${{ matrix.env.name }}
105+
95106 - name : Install dependencies
96107 if : ${{ matrix.env.install-deps }}
97108 run : ${{ matrix.env.install-deps }}
@@ -112,52 +123,74 @@ jobs:
112123 run : |
113124 ./run build:all${{ matrix.env.static && ':static' || '' }}
114125 mkdir -p artifacts
115- ./tools/make_binary_package.sh "artifacts/wasp- ${{ matrix.env. name }}.tar.gz "
126+ ./tools/make_binary_package.sh "artifacts/${{ steps.compute-artifact-names.outputs.tarball- name }}"
116127
117128 - uses : actions/upload-artifact@v4
118129 with :
119- path : ./waspc/artifacts/*
120- name :
121- " wasp-cli-${{ matrix.env.name }}"
122- # This name must be in sync with the artifact name used in:
123- # /.github/actions/fetch-nightly-cli/action.yaml
130+ path : ./waspc/artifacts/${{ steps.compute-artifact-names.outputs.tarball-name }}
131+ name : ${{ steps.compute-artifact-names.outputs.artifact-name }}
124132 if-no-files-found : error
125133
134+ - id : set-outputs
135+ name : Set job outputs
136+ env :
137+ OUTPUT_DATA : ${{ toJson(steps.compute-artifact-names.outputs) }}
138+ run : |
139+ echo "output_${{ matrix.env.name }}=$OUTPUT_DATA" >> $GITHUB_OUTPUT
140+
126141 build-universal :
127142 name : Build Wasp (universal)
128143 needs : build
129144 runs-on : macos-15
130145 steps :
131- - name : Download macOS binaries
146+ - run : echo "$DATA"
147+ env :
148+ DATA : ${{ toJson(needs.build) }}
149+
150+ - uses : actions/checkout@v6
151+
152+ - uses : ./.github/actions/compute-artifact-names
153+ id : compute-artifact-names
154+ with :
155+ build-name : macos-universal
156+
157+ - name : Download macOS Intel binaries
158+ uses : actions/download-artifact@v5
159+ with :
160+ name : " ${{ needs.build.outputs.output_macos-x86_64.artifact-name }}"
161+
162+ - name : Download macOS ARM binaries
132163 uses : actions/download-artifact@v5
133164 with :
134- pattern : wasp-cli-macos-*
165+ name : " ${{ needs.build.outputs.output_macos-aarch64.artifact-name }} "
135166
136167 - name : Unpack, create universal binary and pack
137168 run : |
138169 set -ex # Fail on error and print each command
139170
140- input_arch =(
141- macos -x86_64
142- macos -aarch64
171+ input_files =(
172+ "${{ needs.build.outputs.output_macos -x86_64.tarball-name }}"
173+ "${{ needs.build.outputs.output_macos -aarch64.tarball-name }}"
143174 )
144175
145176 # Extract each architecture
146- for arch in "${input_arch[@]}"; do
147- mkdir "arch-$arch"
148- tar -xzf "wasp-cli-${arch}/wasp-${arch}.tar.gz" -C "arch-$arch"
177+ i=0;
178+ for file in "${input_files[@]}"; do
179+ mkdir "arch-$i"
180+ tar -xzf "$file" -C "arch-$i"
181+ i=$((i + 1))
149182 done
150183
151184 mkdir universal
152185 # Create the universal binary
153186 lipo -create arch-*/wasp-bin -output universal/wasp-bin
154- # Copy the data folder too
155- cp -R "arch-${input_arch[0]} /data" universal/
187+ # Copy the data folder too (we take the first one, should be identical in both)
188+ cp -R "arch-0 /data" universal/
156189
157190 # Pack back up
158- tar -czf wasp-macos-universal.tar.gz -C universal .
191+ tar -czf ${{ steps.compute-artifact-names.outputs.tarball-name }} -C universal .
159192
160193 - uses : actions/upload-artifact@v4
161194 with :
162- name : wasp-cli-macos-universal
163- path : ./wasp-macos-universal.tar.gz
195+ name : ${{ steps.compute-artifact-names.outputs.artifact-name }}
196+ path : ./${{ steps.compute-artifact-names.outputs.tarball-name }}
0 commit comments