Release #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to release (e.g., v1.2.0)' | |
| required: true | |
| type: string | |
| jobs: | |
| changelog: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Generate Changelog | |
| run: npx changelogithub | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| cocoapods: | |
| runs-on: macos-latest | |
| needs: changelog | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| bundler-cache: true | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| VERSION="${{ github.event.inputs.tag }}" | |
| VERSION="${VERSION#v}" | |
| else | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION" | |
| - name: Verify podspec version | |
| run: | | |
| PODSPEC_VERSION=$(grep "s.version" Dimina.podspec | sed -E "s/.*'(.*)'.*/\1/") | |
| if [ "$PODSPEC_VERSION" != "${{ steps.version.outputs.version }}" ]; then | |
| echo "❌ Version mismatch!" | |
| echo "Tag version: ${{ steps.version.outputs.version }}" | |
| echo "Podspec version: $PODSPEC_VERSION" | |
| exit 1 | |
| fi | |
| echo "✅ Version check passed: $PODSPEC_VERSION" | |
| - name: Validate Podspec | |
| run: bundle exec pod lib lint Dimina.podspec --allow-warnings --verbose | |
| - name: Publish to CocoaPods | |
| if: env.COCOAPODS_TRUNK_TOKEN != '' | |
| run: bundle exec pod trunk push Dimina.podspec --allow-warnings | |
| env: | |
| COCOAPODS_TRUNK_TOKEN: ${{secrets.COCOAPODS_TRUNK_TOKEN}} | |
| - name: Skip CocoaPods publish | |
| if: env.COCOAPODS_TRUNK_TOKEN == '' | |
| run: | | |
| echo "⚠️ COCOAPODS_TRUNK_TOKEN not configured" | |
| echo "Skipping CocoaPods publish. See .github/COCOAPODS_SETUP.md for setup instructions." |