Skip to content

Commit 5838d18

Browse files
committed
feat: update release workflow to include changelog generation and CocoaPods validation
1 parent d65f6ef commit 5838d18

1 file changed

Lines changed: 49 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*'
77

88
jobs:
9-
release:
9+
changelog:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
@@ -19,6 +19,52 @@ jobs:
1919
with:
2020
node-version: lts/*
2121

22-
- run: npx changelogithub
22+
- name: Generate Changelog
23+
run: npx changelogithub
2324
env:
24-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
27+
cocoapods:
28+
runs-on: macos-latest
29+
needs: changelog
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Set up Ruby
34+
uses: ruby/setup-ruby@v1
35+
with:
36+
ruby-version: '3.0'
37+
bundler-cache: true
38+
39+
- name: Extract version from tag
40+
id: version
41+
run: |
42+
VERSION=${GITHUB_REF#refs/tags/v}
43+
echo "version=$VERSION" >> $GITHUB_OUTPUT
44+
echo "Extracted version: $VERSION"
45+
46+
- name: Verify podspec version
47+
run: |
48+
PODSPEC_VERSION=$(grep "s.version" Dimina.podspec | sed -E "s/.*'(.*)'.*/\1/")
49+
if [ "$PODSPEC_VERSION" != "${{ steps.version.outputs.version }}" ]; then
50+
echo "❌ Version mismatch!"
51+
echo "Tag version: ${{ steps.version.outputs.version }}"
52+
echo "Podspec version: $PODSPEC_VERSION"
53+
exit 1
54+
fi
55+
echo "✅ Version check passed: $PODSPEC_VERSION"
56+
57+
- name: Validate Podspec
58+
run: bundle exec pod lib lint Dimina.podspec --allow-warnings --verbose
59+
60+
- name: Publish to CocoaPods
61+
if: env.COCOAPODS_TRUNK_TOKEN != ''
62+
run: bundle exec pod trunk push Dimina.podspec --allow-warnings
63+
env:
64+
COCOAPODS_TRUNK_TOKEN: ${{secrets.COCOAPODS_TRUNK_TOKEN}}
65+
66+
- name: Skip CocoaPods publish
67+
if: env.COCOAPODS_TRUNK_TOKEN == ''
68+
run: |
69+
echo "⚠️ COCOAPODS_TRUNK_TOKEN not configured"
70+
echo "Skipping CocoaPods publish. See .github/COCOAPODS_SETUP.md for setup instructions."

0 commit comments

Comments
 (0)