1.0.0 into master #6
This file contains 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: Publish release | |
on: | |
pull_request: | |
branches: | |
- master | |
types: | |
- closed | |
jobs: | |
publish_release: | |
if: github.event.pull_request.merged && (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/')) | |
runs-on: macos-13 | |
steps: | |
- name: Extract version from branch name (for release branches) | |
if: startsWith(github.event.pull_request.head.ref, 'release/') | |
run: | | |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | |
VERSION=${BRANCH_NAME#release/} | |
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Extract version from branch name (for hotfix branches) | |
if: startsWith(github.event.pull_request.head.ref, 'hotfix/') | |
run: | | |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | |
VERSION=${BRANCH_NAME#hotfix/} | |
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Checkout Source | |
uses: actions/checkout@v2 | |
- name: Set up ruby env | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
bundler-cache: true | |
- name: Update release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
tag: ${{ env.RELEASE_VERSION }} | |
- name: Validate manifests | |
run: | | |
bundle exec pod spec lint | |
swift package dump-package | |
- name: Publish pod | |
env: | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
run: bundle exec pod trunk push |