Skip to content

Commit 3936a51

Browse files
committed
Enhance CI workflow for macOS binary packaging
- Added steps to package and upload macOS binaries as tar.gz files in the CI workflow. - Implemented conditional logic to handle macOS-specific artifact uploads, ensuring proper permissions and file handling. - Streamlined the artifact preparation process for macOS targets by copying pre-packaged binaries instead of re-creating them.
1 parent 2f77ca4 commit 3936a51

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,20 @@ jobs:
132132
if: runner.os == 'Linux'
133133
- name: Build release
134134
run: cargo build --release --target ${{ matrix.target }} --verbose
135+
- name: Package macOS binary
136+
if: runner.os == 'macOS'
137+
run: |
138+
chmod +x ${{ matrix.binary-path }}
139+
tar czf ${{ matrix.artifact-name }}.tar.gz -C $(dirname ${{ matrix.binary-path }}) $(basename ${{ matrix.binary-path }})
140+
- name: Upload artifact (macOS)
141+
if: runner.os == 'macOS'
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: ${{ matrix.artifact-name }}
145+
path: ${{ matrix.artifact-name }}.tar.gz
146+
if-no-files-found: error
135147
- name: Upload artifact
148+
if: runner.os != 'macOS'
136149
uses: actions/upload-artifact@v4
137150
with:
138151
name: ${{ matrix.artifact-name }}
@@ -156,11 +169,8 @@ jobs:
156169
chmod +x artifacts/mantle-linux-x86_64/mantle
157170
tar czf mantle-linux-x86_64.tar.gz -C artifacts/mantle-linux-x86_64 mantle
158171
159-
chmod +x artifacts/mantle-macos-aarch64/mantle
160-
tar czf mantle-macos-aarch64.tar.gz -C artifacts/mantle-macos-aarch64 mantle
161-
162-
chmod +x artifacts/mantle-macos-x86_64/mantle
163-
tar czf mantle-macos-x86_64.tar.gz -C artifacts/mantle-macos-x86_64 mantle
172+
cp artifacts/mantle-macos-aarch64/mantle-macos-aarch64.tar.gz mantle-macos-aarch64.tar.gz
173+
cp artifacts/mantle-macos-x86_64/mantle-macos-x86_64.tar.gz mantle-macos-x86_64.tar.gz
164174
165175
mv artifacts/mantle-windows-x86_64/mantle.exe mantle-windows-x86_64.exe
166176
- name: Create GitHub Release

0 commit comments

Comments
 (0)