-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Update release-related fastlane lanes (#583)
- Loading branch information
1 parent
143696d
commit aaa67cb
Showing
5 changed files
with
30 additions
and
53 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,32 +7,47 @@ on: | |
types: | ||
- closed | ||
|
||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release version' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
release: | ||
name: Publish new release | ||
runs-on: macos-13 | ||
if: github.event.pull_request.merged == true # only merged pull requests must trigger this job | ||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }} # only merged pull requests must trigger this job | ||
steps: | ||
- name: Connect Bot | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/ruby-cache | ||
|
||
- name: Extract version from input (for workflow dispatch) | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: | | ||
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | ||
if [ "$BRANCH_NAME" != "main" ]; then | ||
echo "This workflow can only be run on the main branch." | ||
exit 1 | ||
fi | ||
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
- name: Extract version from branch name (for release branches) | ||
if: startsWith(github.event.pull_request.head.ref, 'release/') | ||
if: ${{ github.event_name == 'pull_request' && 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 | ||
- uses: ./.github/actions/ruby-cache | ||
|
||
- name: "Fastlane - Publish Release" | ||
if: startsWith(github.event.pull_request.head.ref, 'release/') | ||
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.pull_request.head.ref, 'release/') }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
|
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
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
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