1+ # This is a basic workflow to help you get started with Actions
2+
3+ name : prerelease PointSDK
4+
5+ # Controls when the action will run. Triggers the workflow on push or pull request
6+ # events but only for the master branch
7+ on :
8+ push :
9+ branches :
10+ - release/***-RC*
11+ tags-ignore :
12+ - ' **'
13+
14+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+ jobs :
16+ # This workflow contains a single job called "build"
17+ release :
18+ # The type of runner that the job will run on
19+ runs-on : ubuntu-latest
20+ name : GitHub release
21+ timeout-minutes : 10
22+
23+ # Steps represent a sequence of tasks that will be executed as part of the job
24+ steps :
25+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26+ - uses : actions/checkout@v2
27+ with :
28+ lfs : true
29+
30+ # Install plistutil
31+ - name : Install plistutil
32+ run : sudo apt-get install libplist-utils
33+
34+ # get version number from the SDK
35+ - name : Extract version number
36+ id : semver
37+ working-directory : PointSDK
38+ run : |
39+ SEMVER=$(plistutil -i ./BDPointSDK.xcframework/ios-arm64/BDPointSDK.framework/Info.plist \
40+ | grep -C 1 CFBundleShortVersionString \
41+ | grep -o '[0-9]*\.[0-9]*\.[0-9]*')
42+
43+ echo "::set-output name=semver::$SEMVER"
44+
45+ # prepare release notes
46+ - name : prepare release notes
47+ working-directory : PointSDK
48+ id : notes
49+ run : |
50+ RELEASE_NAME=$(sed -n -e "s/^# //p" ReleaseNotes.md)
51+ sed "1,/$RELEASE_NAME/ d" ReleaseNotes.md >! ReleaseNotes.md
52+
53+ echo "::set-output name=name::$RELEASE_NAME"
54+
55+ # prepare release assets
56+ - name : prepare pre-release assets
57+ working-directory : PointSDK
58+ run : |
59+ # prepare xcframework
60+ zip -r BDPointSDK.xcframework.zip BDPointSDK.xcframework
61+
62+ # make new GitHub pre-release
63+ - name : create a pre-release
64+ uses : softprops/action-gh-release@v1
65+ with :
66+ body_path : PointSDK/ReleaseNotes.md
67+ name : ${{ steps.notes.outputs.name }}
68+ tag_name : ${{ steps.semver.outputs.semver }}
69+ prerelease : true
70+ files : |
71+ PointSDK/BDPointSDK.xcframework.zip
72+ env :
73+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments