Skip to content

Commit d17bda7

Browse files
committed
ci: add create-github-release.yml to make tagged release with zips
Creates GH release for OneSignal-iOS-SDK. Does not create release for OneSignal-XCFramework
1 parent 4aa5e4a commit d17bda7

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Create GitHub Release
2+
3+
# This workflow creates a GitHub release in iOS-SDK and attaches the built zip files.
4+
# Run this AFTER the release PR has been merged.
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
ref:
10+
description: 'Branch or commit SHA to run on (e.g., main, 5.3-main)'
11+
type: string
12+
required: false
13+
default: 'main'
14+
15+
permissions:
16+
contents: write
17+
pull-requests: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
# Step 1: Extract version from podspec
25+
get-version:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
version: ${{ steps.extract_version.outputs.version }}
29+
steps:
30+
- name: Checkout OneSignal-iOS-SDK
31+
uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.inputs.ref }}
34+
35+
- name: Extract release version from podspec
36+
id: extract_version
37+
run: |
38+
VERSION=$(grep -E "s.version\s*=" OneSignal.podspec | sed -E 's/.*"(.*)".*/\1/')
39+
echo "version=$VERSION" >> $GITHUB_OUTPUT
40+
echo "Extracted version: $VERSION"
41+
42+
# Step 2: Use reusable workflow to create GitHub release with release notes
43+
create-release:
44+
needs: get-version
45+
uses: OneSignal/sdk-actions/.github/workflows/github-release.yml@main
46+
with:
47+
version: ${{ needs.get-version.outputs.version }}
48+
49+
# Step 3: Upload the 10 xcframework zips to the release
50+
upload-assets:
51+
needs: [get-version, create-release]
52+
runs-on: macos-13
53+
54+
env:
55+
VERSION: ${{ needs.get-version.outputs.version }}
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
steps:
59+
- name: Checkout OneSignal-iOS-SDK
60+
uses: actions/checkout@v4
61+
with:
62+
ref: ${{ github.event.inputs.ref }}
63+
64+
- name: 📋 Display Configuration
65+
run: |
66+
echo "============================================"
67+
echo "📦 Uploading assets for version: $VERSION"
68+
echo "============================================"
69+
70+
- name: Upload xcframework zips to release
71+
run: |
72+
cd iOS_SDK/OneSignalSDK
73+
74+
gh release upload "$VERSION" \
75+
OneSignalCore.xcframework.zip \
76+
OneSignalExtension.xcframework.zip \
77+
OneSignalFramework.xcframework.zip \
78+
OneSignalInAppMessages.xcframework.zip \
79+
OneSignalLiveActivities.xcframework.zip \
80+
OneSignalLocation.xcframework.zip \
81+
OneSignalNotifications.xcframework.zip \
82+
OneSignalOSCore.xcframework.zip \
83+
OneSignalOutcomes.xcframework.zip \
84+
OneSignalUser.xcframework.zip
85+
86+
echo "✅ All xcframework zips uploaded successfully!"
87+
echo "🔗 https://github.com/${{ github.repository }}/releases/tag/$VERSION"

0 commit comments

Comments
 (0)