File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 - ' mac/**'
2626 - ' package_creators/**'
2727 - ' src/rust/**'
28+ release :
29+ types : [published]
2830jobs :
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
You can’t perform that action at this time.
0 commit comments