-
Notifications
You must be signed in to change notification settings - Fork 41
85 lines (72 loc) · 2.97 KB
/
create-release-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Create release branch
on:
workflow_dispatch:
inputs:
versionName:
description: 'Name of version (ie 1.3.0)'
required: true
jobs:
createrelease:
name: Create release branch
runs-on: ubuntu-latest
#if: contains(github.ref, 'develop') # Only for develop branch
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Bundle Install
run: bundle install
- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.versionName }}
- name: Initialize mandatory git config
run: |
git config user.name "Tangem Bot"
git config user.email [email protected]
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Bump version in Podspec file
run: bundle exec fastlane run version_bump_podspec path:"TangemSdk.podspec" version_number:${{ github.event.inputs.versionName }}
- name: Change version
run: echo ${{ github.event.inputs.versionName }} > VERSION
- name: Create Changelog
run: |
git fetch origin master:master
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s' --abbrev-commit --date=relative origin/master..${{ steps.extract_branch.outputs.branch }} > CHANGELOG
- name: Commit and push changes
run: |
git commit -am "Prepare release version ${{ github.event.inputs.versionName }}"
git push origin release/${{ github.event.inputs.versionName }}
- uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: "release/${{ github.event.inputs.versionName }}",
base: "master",
title: "Release version ${{ github.event.inputs.versionName }}",
});
- name: Slack notification
if: always()
uses: adamkdean/simple-slack-notify@master
with:
channel: '#development-ios'
status: ${{ job.status }}
success_text: 'Card SDK: Release banch has been created'
failure_text: 'Card SDK: Release creation failed'
cancelled_text: 'Card SDK: Release creation cancelled'
fields: |
[{"title": "Source Branch", "value": "${{ steps.extract_branch.outputs.branch }}"},
{"title": "Release Branch", "value": "release/${{ github.event.inputs.versionName }}"},
{"title": "Initiator", "value": "${{ github.actor }}"},
{"title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DVELOPMENT_IOS }}