Skip to content

Commit 576c727

Browse files
authored
[IMPROVEMENT]: Add macOS binary to GitHub Releases (#2274)
* ci: upload macOS binary to GitHub release on publish * ci: version macOS release artifact as ccextractor-<version>-macos
1 parent 9440749 commit 576c727

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/build_mac.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ on:
2525
- 'mac/**'
2626
- 'package_creators/**'
2727
- 'src/rust/**'
28+
release:
29+
types: [published]
2830
jobs:
2931
build_shell:
3032
runs-on: macos-latest
@@ -40,12 +42,30 @@ jobs:
4042
working-directory: ./mac
4143
- name: Prepare artifacts
4244
run: mkdir ./mac/artifacts
45+
- name: Get version
46+
id: version
47+
run: |
48+
if [ "${{ github.event_name }}" = "release" ]; then
49+
VERSION="${{ github.event.release.tag_name }}"
50+
VERSION="${VERSION#v}"
51+
else
52+
VERSION=$(sed -n 's/#define VERSION "//;s/"//p' src/lib_ccx/lib_ccx.h 2>/dev/null | head -1 || echo "dev")
53+
fi
54+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
55+
echo "filename=ccextractor-${VERSION}-macos" >> "$GITHUB_OUTPUT"
4356
- name: Copy release artifact
44-
run: cp ./mac/ccextractor ./mac/artifacts/
57+
run: cp ./mac/ccextractor ./mac/artifacts/${{ steps.version.outputs.filename }}
4558
- uses: actions/upload-artifact@v7
4659
with:
4760
name: CCExtractor mac build
48-
path: ./mac/artifacts
61+
path: ./mac/artifacts/${{ steps.version.outputs.filename }}
62+
- name: Upload macOS binary to Release
63+
if: github.event_name == 'release'
64+
uses: softprops/action-gh-release@v3
65+
with:
66+
files: ./mac/artifacts/${{ steps.version.outputs.filename }}
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4969
build_shell_system_libs:
5070
# Test building with system libraries via pkg-config (for Homebrew formula compatibility)
5171
runs-on: macos-latest

0 commit comments

Comments
 (0)